Re: numeric issue: 0.95 - 0.05 == 0.8499996
- From: ~kurt <actinouranium@xxxxxxxxxxxxx>
- Date: Thu, 10 May 2007 03:56:33 GMT
Christian <fakemail@xxxxxx> wrote:
but around 1 the precision of floats should be much higher .. I could
understand this "mistake" if he subtracted 3 times 0.05f
This is about the inability to accurately represent decimal numbers
in binary format. 8/9 is close to 1 - not a large or small number.
But, you can not represent it in decimal format with a finite number
of digits. In the same way, you can not represent various finite decimal
numbers in binary with a finite number of 1's and 0's.
- Kurt
.
- Follow-Ups:
- Re: numeric issue: 0.95 - 0.05 == 0.8499996
- From: Christian
- Re: numeric issue: 0.95 - 0.05 == 0.8499996
- References:
- numeric issue: 0.95 - 0.05 == 0.8499996
- From: Maciej
- Re: numeric issue: 0.95 - 0.05 == 0.8499996
- From: Philipp Taprogge
- Re: numeric issue: 0.95 - 0.05 == 0.8499996
- From: Christian
- numeric issue: 0.95 - 0.05 == 0.8499996
- Prev by Date: Re: WebServices and .NET
- Next by Date: using JSP and JavaBeans to enter data in MySQL database
- Previous by thread: Re: numeric issue: 0.95 - 0.05 == 0.8499996
- Next by thread: Re: numeric issue: 0.95 - 0.05 == 0.8499996
- Index(es):
Relevant Pages
|