Top "Floating-accuracy" questions

Concerning the accuracy of operations performed on floating point numbers.

Is floating point math broken?

Consider the following code: 0.1 + 0.2 == 0.3 -> false 0.1 + 0.2 -> 0.30000000000000004 Why do these inaccuracies happen?

math language-agnostic floating-point floating-accuracy
Dealing with float precision in Javascript

I have a large amount of numeric values y in javascript. I want to group them by rounding them down …

javascript floating-point double floating-accuracy numerical-methods
What's wrong with using == to compare floats in Java?

According to this java.sun page == is the equality comparison operator for floating point numbers in Java. However, when I …

java equality floating-accuracy
Truncate (not round off) decimal numbers in javascript

I am trying to truncate decimal numbers to decimal places. Something like this: 5.467 -> 5.46 985.943 -> 985.94 toFixed(2) does just …

javascript floating-point floating-accuracy
Floating point inaccuracy examples

How do you explain floating point inaccuracy to fresh programmers and laymen who still think computers are infinitely wise and …

floating-point floating-accuracy
How dangerous is it to compare floating point values?

I know UIKit uses CGFloat because of the resolution independent coordinate system. But every time I want to check if …

objective-c ios c floating-point floating-accuracy
How to do an integer log2() in C++?

In the C++ standard libraries I found only a floating point log method. Now I use log to find the …

c++ floating-accuracy logarithm
Is floating point arbitrary precision available?

Just for fun and because it was really easy, I've written a short program to generate Grafting numbers, but because …

python floating-point floating-accuracy
C++ floating point precision

Possible Duplicate: Floating point inaccuracy examples double a = 0.3; std::cout.precision(20); std::cout << a << std::endl; …

c++ c floating-point precision floating-accuracy
How to avoid floating point precision errors with floats or doubles in Java?

I have a very annoying problem with long sums of floats or doubles in Java. Basically the idea is that …

java sum floating-accuracy