Rounding problem in Java for float, double types


Here is a sample java program that I wrote. It shows that for all of Double, double, Float, float you can't rely on default rounding operation of java/jvm. I think even JVM to JVM implementation (sun windows jvm vs ibm linux jvm for example) the output may vary. Can someone confirm it? public class DoubleAndFloatIssue… Continue reading Rounding problem in Java for float, double types