Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class P4_FloatingEquality {
- public static void main(String[] args) {
- Scanner scan = new Scanner(System.in);
- float a = Float.parseFloat(scan.nextLine());
- float b = Float.parseFloat(scan.nextLine());
- final float precisionLevel = 0.000001f;
- if (Math.abs(a-b) >= precisionLevel){
- System.out.println("False");
- } else{
- System.out.println("True");
- }
- }
- }
Add Comment
Please, Sign In to add comment