Fernando Ariel Gont wrote in a message to All:
FAG> Is it true that this piece of code:
FAG> randomize();
FAG> int a=random(0);
FAG> may generate a "Divide error"??
Since randomize() and random() are non-standard, it could do anything and get
away with it :-) (damn, been reading too much comp.lang.c lately )
But yes, it is very possible for random() to cause a divide error, for
example if it is implemented using the modulo operator (which is a lousy
implementation because your random distribution of numbers is not kept
intact).
Why would you want to do random(0) anyway ? Not very random, is it ? ;-)
greetz,
Tom
tomtorfs@mail.dma.be
--- timEd/2 1.10+
---------------
* Origin: 80X86 BBS 32-15-24.62.32 V.34/V.FC (24h/24h) (2:292/516)
|