[Top][All Lists]

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

Re: number->string radix patch

From: Kevin Ryde
Subject: Re: number->string radix patch
Date: Fri, 28 May 2004 07:54:35 +1000
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3 (gnu/linux)

Richard Todd <address@hidden> writes:
> Those second
> two answers are only different in the least significant numbers, which
> looks like different amounts of rounding error to me.

Neither input nor output code keeps a tight rein on accuracy as far as
I can tell, it loses on decimal I think.

But what's not good is that there's some rounding in hex output, for

        (number->string #i#x1FFFFFFFFFFFF 16)
        => "2.0eC"

where I expected "1.FFFFFFFFFFFFeC" or whatever.  Non-power-of-2 bases
are going to round, but I'd have thought an important point for power
of 2 bases would be that they don't round.

I haven't tried to look where it goes wrong, but this is on my i386
debian, built with CFLAGS=-g (ie. no optimizations).  I added some
printfs into idbl2str and saw the value from the input is correct,
ie. contains lots of 1 bits, the rounding to 2.0 is apparently in the

reply via email to

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