Re: Can someone please explain - real numbers
- From: John Dough <nobody@xxxxxxxxxxxxxxx>
- Date: Wed, 08 Nov 2006 21:49:16 -0500
On Wed, 08 Nov 2006 20:51:34 GMT, Chris Cheney
<XXChris.CheneyXX@xxxxxxxxx> wrote:
Note that, for example, the simple decimal fraction 0.1 is the recurring
binary fraction 0.0001100110011001100110011001100110 (0110 recurring) and
cannot therefore be stored precisely as a single/double/extended/real.
The FPU knows how to handle repeating fractions, regardless of their
base. The repeating portion is truncated (and rounded, if necessary)
at the last available digit of precision for any given float type. In
the case of "extended", the decimal portion terminates at the 18th
position.
I'm not sure what leads you to believe that 0.1 cannot be stored
precisely. Did you try it with code? I did...and it works fine.
I can store 0.1, and I get back 0.1
If you get back what you store, then by all accounts, it's precise.
.
- Follow-Ups:
- Re: Can someone please explain - real numbers
- From: Chris Cheney
- Re: Can someone please explain - real numbers
- From: Dr J R Stockton
- Re: Can someone please explain - real numbers
- From: Hans-Peter Diettrich
- Re: Can someone please explain - real numbers
- From: Maarten Wiltink
- Re: Can someone please explain - real numbers
- From: Sven Pran
- Re: Can someone please explain - real numbers
- References:
- Can someone please explain - real numbers
- From: Paul W
- Re: Can someone please explain - real numbers
- From: Paul W
- Re: Can someone please explain - real numbers
- From: Nicholas Sherlock
- Re: Can someone please explain - real numbers
- From: Paul W
- Re: Can someone please explain - real numbers
- From: John Dough
- Re: Can someone please explain - real numbers
- From: Chris Cheney
- Can someone please explain - real numbers
- Prev by Date: Re: What about this solution ?
- Next by Date: Re: What about this solution ?
- Previous by thread: Re: Can someone please explain - real numbers
- Next by thread: Re: Can someone please explain - real numbers
- Index(es):
Relevant Pages
|