#B2026. Double Precision Remainder Calculation
Double Precision Remainder Calculation
Double Precision Remainder Calculation
Given two double-precision floating-point numbers \(a\) and \(b\) (with \(b > 0\)), compute the remainder \(r\) such that \(a = k \times b + r\), where \(k\) is an integer and \(0 \le r < b\). In other words, using the formula:
\[ r = a - k \times b, \quad \text{with} \quad k = \lfloor a/b \rfloor \]
Output the value of \(r\).
inputFormat
The input consists of two double-precision floating point numbers \(a\) and \(b\) separated by space.
outputFormat
Output a single double representing the remainder \(r\) computed using the formula \(r = a - \lfloor a/b \rfloor \times b\).
sample
5.3 2.0
1.3