guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: number->string radix patch


From: Richard Todd
Subject: Re: number->string radix patch
Date: Tue, 11 May 2004 00:23:11 -0500

I built guile from CVS on my Mac G5, and I get the same results I did originally:

/tmp/bldguile richardt$ guile
guile> (number->string 0.25 2)
"0.01"
guile>  (number->string 11.33333333333333333 12)
"B.4"
guile> (number->string 1.324e44 16)
"5.EFE0A14FAFEe24"
guile>

I had done the original patch on a G4 machine. I'm thinking it's a precision difference between macs and intel machines. Those second two answers are only different in the least significant numbers, which looks like different amounts of rounding error to me. Someone with an intel box may be able to do some tuning of the tolerance parameters in the algorithm. I'd be happy to help in any way I can, but it may be an unavoidable difference.


On May 10, 2004, at 3:34 PM, Marius Vollmer wrote:

Richard Todd <address@hidden> writes:

On Mon, Jan 05, 2004 at 06:36:07PM -0700, Robert Uhl wrote:
Although my one true project is to figure out number->string well enough to make it Do the Right Thing for decimals in bases other than 10 (I'm a
big fan of duodecimal).

I've seen this wish twice from you in the short time I've been
watching guile-user, so I took a crack at it.

Ok, I have finally installed your patch.  Thanks again!  (I wrote a
basic ChangeLog entry, but please do that yourself for the next
patch.)

I used your examples as test cases, but cannot reproduce some:

guile> (number->string 0.25 2)
"0.01"
guile> (number->string 11.33333333333333333 12)
"B.4"
guile> (number->string 1.324e44 16)
"5.EFE0A14FAFEe24"

I get

  guile> (number->string 0.25 2)
  "0.010"
  guile> (number->string 11.33333333333333333 12)
  "B.400000000000009"
  guile> (number->string 1.324e44 16)
  "5.EFE0A14FAFDF8e24"

The first looks certainly wrong, but I'm not sure about the other two.
Richard, could you try to investigate this?

--
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3  331E FAF8 226A D5D4 E405






reply via email to

[Prev in Thread] Current Thread [Next in Thread]