CSE 6341 Code examples
Floating-point addition in Java
class Test {
public static void main(String[] args) {
double x = (0.1 + 0.2) + 0.3;
double y = 0.1 + (0.2 + 0.3);
System.out.println(x==y);
} }
CSE 6341 Code examples
Floating-point addition in Java
class Test {
public static void main(String[] args) {
double x = (0.1 + 0.2) + 0.3;
double y = 0.1 + (0.2 + 0.3);
System.out.println(x==y);
} }