#PCBBAY0000005. Sai số tuyệt đối (Absolute Error)
Sai số tuyệt đối (Absolute Error)
Absolute Error
Version: Phuoc Hung OJ Extended
Problem Statement
A measurement yields an approximate value and a reference value . Their absolute error is . Calculate and display exactly 6 digits after the decimal point.
Input
The only line contains the approximate real value and reference value .
Output
Print the absolute error with exactly 6 decimal places.
Subtasks
- Subtask 1 (100 points): are finite.
Examples
Example 1
Input
99.9 100
Output
0.100000
Explanation. Substituting the input into the formula gives |99.9-(100)| ≈ 0.1. Formatting with six decimal places produces 0.100000.
Example 2
Input
1.01 1.0
Output
0.010000
Explanation. Substituting the input into the formula gives |1.01-(1.0)| ≈ 0.01. Formatting with six decimal places produces 0.010000.
Example 3
Input
-9.9 -10.0
Output
0.100000
Explanation. Substituting the input into the formula gives |-9.9-(-10.0)| ≈ 0.1. Formatting with six decimal places produces 0.100000.