For Programmers: Free Programming Magazines  


Home > Archive > ASM370 > May 2006 > Re: S/360









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: S/360
robin

2006-05-29, 6:57 pm

"glen herrmannsfeldt" <gah@ugcs.caltech.edu> wrote in message
news:qdadnW50orKK3ufZRVn-sQ@comcast.com...
> robin wrote:
>
>
> The precision is between 21 and 24 for short,


I'm referring to the guaranteed precision.

> and between
> 56 and 53 for long. The algorithms for the most libraries
> were designed not to lose precision unnecessarily.
>
> 0.9 has 24 bits of precision in short float.


Well, only 21 bits. You can't count on more.

> Divide it by
> four and it loses two bits. Multiply or divide the result by four
> and you don't gain them back again, though the bits are again
> available. That is precision loss.


It isn't, because only 21 bits a guaranteed, and that's what you get.

BTW, if you divide an integer by 4, you lose two bits, and
you don't get them back when you multiply the result by 4.

And if you multiply .9 by 10 you don't get 9.


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com