#t207. 计算分数的浮点数值
计算分数的浮点数值
Floating-Point Value of a Fraction
Problem Background
Special for beginners, ^_^
Problem Description
Two integers and are given as the numerator and denominator, respectively, of the fraction . Compute its floating-point value (a double-precision floating-point number, kept to 9 decimal places).
Input Format
A single line containing two integers and ().
Output Format
A single line containing the floating-point value of the fraction (a double-precision floating-point number, kept to 9 decimal places).
Sample Input
5 7
Sample Output
0.714285714
Constraints
1s, 1024KiB for each test case.
Hint
- Writing
a / bdirectly gives 0 — dividing twointvalues yields no fractional part. Think about how to make the division produce a decimal. - To keep 9 decimal places: use
fixedtogether withsetprecision(9). - Check against the sample:
5 7→0.714285714.