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 not a
reader bug:

  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!
  guile> (exact->inexact x)
  123123123123123000.0

This is executed on a Guile before Han-Wen's fix, FWIW.  Perhaps people
more knowledgeable about this will have an idea of what's going wrong.

Thanks,
Ludovic.



_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel

Reply via email to