I've tried executing the below program and the output looks unusual.
public class FloatingPointIssue {
public static strictfp void main(String[] args) {
float floatValue = 277677.86f;
double doubleValue = 277677.86;
System.out.println(floatValue);
System.out.println(doubleValue);
}
Output :
277677.88 277677.86
There is absolutely no issue using double but when I tried the same with float, the output is not as expected. Can someone try to explain me what's happening internally(while using float) that actually caused this issue.
Many thanks :)