Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.apache.commons.math3.util.Precision;
- public class PrecisionTest {
- public static void main(String[] args) {
- double x = 4.0;
- double y = -1.0;
- boolean isEqual = Precision.equals(x, y , 10E-14);
- System.out.println(isEqual);
- System.out.println(Precision.compareTo(x, y , 10E-14));
- System.out.println(x==y);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement