Advertisement
meteor4o

Java-Fund-DataMore- 03.FloatingEquality

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