0

I am using java in intellij idea and while dealing with floating points but compiler isn't returning absolute value if answer is 0.1 then it is returning 0.099998474

There is sample code I am using:

float f1;
f1 = 66.1f % 6f;
System.out.println(f1);
Jon Skeet
  • 1,421,763
  • 867
  • 9,128
  • 9,194

0 Answers0