When I enter 1.000001 and 1.000002 I get "The numbers are not equal". When I enter 16574837432.0000002 and 16574837432.00000003 I get "The numbers are equal". I am not understanding how to cause the program to get the difference only up to the millionths place value and then determine the output statement from there.
package en.codegym.task.pro.task03.task0311;
import java.util.Scanner;
/*
High accuracy
*/
public class Solution {
public static void main(String[] args) {
//write your code here
Scanner sc = new Scanner(System.in);
double num1, num2, diff;
Boolean isEqual;
num1 = sc.nextDouble();
num2 = sc.nextDouble();
isEqual = (num1 == num2) ? true:false;
if (isEqual)
System.out.println("The numbers are equal");
//write your code here
if (!isEqual)
System.out.println("The numbers are not equal");
}
}