Re: n accuracy
- From: Vassil Nikolov <vnikolov+usenet@xxxxxxxxx>
- Date: 30 May 2007 22:41:52 -0400
On Wed, 30 May 2007 14:17:09 +0300, "Alex Mizrahi" <udodenko@xxxxxxxxxxxxxxxxxxxxx> said:
| ...
| ??>> 2.7182817
| ??>> last value looks a bit strange, double and long versions have all
| ??>> digits correct.
| BM> What do you get if you simply type:
| BM> 2.7182818
| BM> ?
| it gets converted to ..17. it appears that single-presision IEEE 754 numbers
| are not able to represent that decimal value correctly.
No base-power-of-2 floating-point representation, including IEEE
754, can represent either 2.7182817 or 2.7182818 _exactly_; all of
them can, of course, represent both numbers _correctly_ according to
the rules of floating-point representations...
---Vassil,
in pedantic mode...
--
The truly good code is the obviously correct code.
.
- References:
- n accuracy
- From: fireblade
- Re: n accuracy
- From: Edi Weitz
- Re: n accuracy
- From: Alex Mizrahi
- Re: n accuracy
- From: Barry Margolin
- Re: n accuracy
- From: Alex Mizrahi
- n accuracy
- Prev by Date: Continuation based app servers
- Next by Date: Re: code critique
- Previous by thread: Re: n accuracy
- Next by thread: Re: n accuracy
- Index(es):
Relevant Pages
|