I am having problem with comparing two double numbers up to 3 decimal places. When I try to round 3.1756, I always get 3.176 the last number changes due to 6 last number. Please, help me to get exact number (3.175) from whole decimal numbers.
Asked
Active
Viewed 4,392 times
1
-
double? Must read good article about floating point. Genrally known is limit of accuracy, but not knowt "representation problem". For strict application use BigDecimal – Jacek Cz Jul 08 '18 at 10:20
-
Make up your mind. Your title says ';decimal numbers' but your question says 'double numbers'. They aren't the same thing. – user207421 Jul 08 '18 at 10:34