Re: Bug with large fractions

2007-01-09 Thread Ludovic Courtès
Hi, [EMAIL PROTECTED] (Ludovic Courtès) writes: > guile> (define x (* 123123123123123123 100)) > guile> x > 12312312312312312300 > guile> (set! x (+ x 12)) > guile> x > 12312312312312312312 > guile> (set! x (/ x 100)) > guile> x > 3078078078078078078/25 ;; this is wrong! The fr

Re: Bug with large fractions

2007-01-09 Thread Ludovic Courtès
Hi, Kevin Ryde <[EMAIL PROTECTED]> writes: > [EMAIL PROTECTED] (Ludovic Courtès) writes: >> >> guile> 123123123123123123.12 >> 123123123123123000.0 > > I think it's been truncated to 53 bits for the mantissa of a double. Right, the value can't actually fit into a double and reals in Guile _a

Re: Bug with large fractions

2007-01-07 Thread Kevin Ryde
[EMAIL PROTECTED] (Ludovic Courtès) writes: > > guile> 123123123123123123.12 > 123123123123123000.0 I think it's been truncated to 53 bits for the mantissa of a double. (Unless you mean the rounding went the wrong way or something.) ___ Guile-devel

Bug with large fractions

2007-01-06 Thread Ludovic Courtès
Hi, Before I forget about it, I noticed a bug with large fractions. It shows up in the following example: guile> 123123123123123123.12 123123123123123000.0 A quick look at numbers.c:mem2decimal_from_point, and then trying to re-execute the algorithm in there by hand shows that this is