Re: double with precision
- From: Thomas Fritsch <i.dont.like.spam@xxxxxxxxxxx>
- Date: Thu, 28 Jun 2007 00:42:46 +0200
Roy Gourgi schrieb:
Thanks Eric,Java internally stores doubles as a sum of powers of 2 (1, 0.5, 0.25, 0.125, ...). Fractionizing of 1.74 yields
Just out of curiosity why can't the number 1.74 be represented exactly with a double?
1.74 = 1 * 1
+ 1 * 0.5
+ 0 * 0.25
+ 1 * 0.125
+ 1 * 0.0625
+ 1 * 0.03125
...
which is a never ending series.
--
Thomas
.
- References:
- double with precision
- From: Roy Gourgi
- Re: double with precision
- From: Roy Gourgi
- double with precision
- Prev by Date: Re: double with precision
- Next by Date: Re: double with precision
- Previous by thread: Re: double with precision
- Next by thread: Re: double with precision
- Index(es):