equal
deleted
inserted
replaced
336 } |
336 } |
337 |
337 |
338 LongInt fpcrtl_random(LongInt l) { |
338 LongInt fpcrtl_random(LongInt l) { |
339 // random(0) is undefined in docs but effectively returns 0 in free pascal |
339 // random(0) is undefined in docs but effectively returns 0 in free pascal |
340 if (l == 0) { |
340 if (l == 0) { |
341 printf("WARNING: random(0) called!"); |
341 printf("WARNING: random(0) called!\n"); |
342 return 0; |
342 return 0; |
343 } |
343 } |
344 return (LongInt) (rand() / (double) RAND_MAX * l); |
344 return (LongInt) (rand() / (double) RAND_MAX * l); |
345 } |
345 } |
346 |
346 |