On Dec 31, 11:15 am, "Dr. David Kirkby" <david.kir...@onetel.net>
wrote:

> > RJF
>
> The point you are missing is that we want to compare the output what Sage 
> prints
> to a human.
>

The point you are missing is that the following item, which presumably
could be printed by Sage,
is perfectly readable to a human:

6121026514868073 * 2^(-51).

It exactly dictates the bits in an IEEE double-float, and does not
require any conversion from binary
to decimal. It does not need rounding.  This kind of representation
does not have any hidden unprinted digits.  It does not ever need to
be longer because of delicate edge conditions of certain numbers.

It happens to evaluate to
APPROXIMATELY   2.718281828459045

a more accurate rendition of that same number, again in decimal is
2.7182818284590450907955982984....


although a more accurate rendition of exp(1) looks like this.
2.7182818284590452353602874713....

If you want to compare the results of 2 numerical computations for
exact identical bits, then I suggest you
look at the bits.

The fact that two different systems get slightly different answers is
not necessarily an indication of an error.

RJF







> Comparing the bits of a floating point number would not help as a test suite. 
> If
> two systems have the same 64 bits to indicate the number, a bug in the code
> which converts that to ASCII would not be detected. The tests compare ASCII
> text, not numbers.
>
> I would accept for some randomised testing, it might be better to bypaass the
> binary to ASCII conversion, as it would allow for more tests to be conducted 
> in
> less time. But not in general would that be a good idea.
>
> It's 20+ years since I done any assembly language programming - that was on an
> 386/387 chip, then later on a VAX - never SPARC. So I'd be at a loss really.
> (BTW, after programming on a VAX, you realise how limited the x86 series was).
>
> Dave

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to