// ExploreRealNumbersV2.java
// Aaron Tan
//
// To compare two real numbers allowing small difference.

import java.util.*;

class ExploreRealNumbersV2 {
 
    public static void main(String[] args) {

        final double EPSILON = 0.0001;  // tolerance

        Scanner scanner = new Scanner(System.in);

        System.out.print("Enter value: ");
        double value1 = scanner.nextDouble();

        double value2 = (value1/5.0) * 5.0;

        System.out.println("value1 = " + value1);
        System.out.println("value2 = " + value2);

        if (Math.abs(value1 - value2) < EPSILON)
            System.out.println("The values are the same.");
        else
            System.out.println("The values are not the same.");
    }

}


