comparison src/paranormal/libcalc/function.c @ 1179:f121f2b1711a trunk

[svn] - use g_random_double_ranged()
author nenolod
date Fri, 08 Jun 2007 15:02:31 -0700
parents 44d28af95a23
children f1b6f1b2cdb3
comparison
equal deleted inserted replaced
1178:e9b2d21cf078 1179:f121f2b1711a
72 int x = (int)pop (stack); 72 int x = (int)pop (stack);
73 return (y == 0) ? 0 : (x / y); 73 return (y == 0) ? 0 : (x / y);
74 } 74 }
75 75
76 static double f_rand (ex_stack *stack) { 76 static double f_rand (ex_stack *stack) {
77 return rand() % (int) pop(stack); 77 return g_random_double_range((double) pop(stack), (double) pop(stack));
78 } 78 }
79 79
80 /* */ 80 /* */
81 81
82 static const func_t init[] = { 82 static const func_t init[] = {