Posted: Mon Nov 07, 2005 7:24 pm Post subject: (No subject)
and how would i solve this problem and make java add like it should be?
wtd
Posted: Mon Nov 07, 2005 7:40 pm Post subject: (No subject)
Floating point numbers cannot be natively represented inside a computer. Therefore we have a Pretty Good(tm) way of estimating them to a fair degree of accuracy.
person
Posted: Mon Nov 07, 2005 7:53 pm Post subject: (No subject)
Quote:
Floating point numbers cannot be natively represented inside a computer. Therefore we have a Pretty Good(tm) way of estimating them to a fair degree of accuracy.
so basically, there's no way to actually do addition with decimals in java?
wtd
Posted: Mon Nov 07, 2005 8:18 pm Post subject: (No subject)
Not to complete accuracy. The issue is not restricted to Java.
person
Posted: Mon Nov 07, 2005 8:23 pm Post subject: (No subject)
Quote:
Not to complete accuracy. The issue is not restricted to Java.
k, i know languages like turing has the same problem but y does turing not output 0.30000000000004 for 0.1+0.2? does turing hava another way of calculating hte numbers?
wtd
Posted: Mon Nov 07, 2005 8:43 pm Post subject: (No subject)
person wrote:
Quote:
Not to complete accuracy. The issue is not restricted to Java.
k, i know languages like turing has the same problem but y does turing not output 0.30000000000004 for 0.1+0.2? does turing hava another way of calculating hte numbers?
It's just a matter of how it outputs the number. It like rounds to a certain place by default. Many environments will round to something like 8-10 places.