/[gcl]/gcl/o/num_rand.c
ViewVC logotype

Diff of /gcl/o/num_rand.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by camm, Thu Nov 6 16:08:10 2003 UTC revision 1.6 by camm, Sat Nov 27 22:19:35 2004 UTC
# Line 42  rando(object x, object rs) Line 42  rando(object x, object rs)
42          tx = type_of(x);          tx = type_of(x);
43          if (number_compare(x, small_fixnum(0)) != 1)          if (number_compare(x, small_fixnum(0)) != 1)
44                  FEwrong_type_argument(TSpositive_number, x);                  FEwrong_type_argument(TSpositive_number, x);
45            /*FIXME 64*/
46          d = (double)(rs->rnd.rnd_value>>1) / (4294967296.0/2.0);          d = (double)(rs->rnd.rnd_value>>1) / (4294967296.0/2.0);
47          d = number_to_double(x) * d;          d = number_to_double(x) * d;
48          if (tx == t_fixnum) {          if (tx == t_fixnum) {
49                  z = make_fixnum((int)d);                  z = make_fixnum((fixnum)d);
50                  return(z);                  return(z);
51          } else if (tx == t_bignum) {          } else if (tx == t_bignum) {
52                  z = double_to_integer(d);                  z = double_to_integer(d);

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26