#PCBBAY0000003. So sánh theo dung sai tuyệt đối (Absolute-Tolerance Comparison)
So sánh theo dung sai tuyệt đối (Absolute-Tolerance Comparison)
Absolute-Tolerance Comparison
Version: Phuoc Hung OJ Extended
Problem Statement
Given real numbers , and a nonnegative absolute tolerance , regard the two numbers as close when . Report the result of Python 3 math.isclose(a, b, rel_tol=0.0, abs_tol=eps); no relative tolerance is used.
Input
The only line contains real numbers , and absolute tolerance , in that order.
Output
Print exactly True if , otherwise False.
Subtasks
- Subtask 1 (100 points): are finite and .
Examples
Example 1
Input
0.30000000000000004 0.3 1e-09
Output
True
Explanation. The computed difference is approximately 5.55111512313e-17 and the permitted tolerance is 1e-09. The difference is ≤ the tolerance, so the answer is True.
Example 2
Input
1.0 1.0000000001 1e-08
Output
True
Explanation. The computed difference is approximately 1.00000008274e-10 and the permitted tolerance is 1e-08. The difference is ≤ the tolerance, so the answer is True.
Example 3
Input
1000 1000.01 0.0001
Output
False
Explanation. The computed difference is approximately 0.00999999999999 and the permitted tolerance is 0.0001. The difference is > the tolerance, so the answer is False.