Advertisement
CR7CR7

floatee

Oct 12th, 2022
594
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.48 KB | None | 0 0
  1. import java.util.Scanner;
  2. class FloatingNumber {
  3.     public static void main(String[] args) {
  4.         Scanner sc =new Scanner(System.in);
  5.             double eps = 0.000001;
  6.             double a = Double.parseDouble(sc.nextLine());
  7.             double b = Double.parseDouble(sc.nextLine());
  8.  
  9.             if (Math.abs(a-b) < eps){
  10.                 System.out.println("True");
  11.             }
  12.             else {
  13.                 System.out.println("False");
  14.             }
  15.         }
  16.     }
  17.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement