LearnPy Hub
← Data Types & Casting problems
Medium

Floating Point Surprise

Read two decimals a and b. Print a + b as Python shows it, then round(a + b, 2), then whether abs((a + b) - 0.3) < 1e-9.

Input

Two numbers, one per line.

Output

Three lines.

Sample 1

Input
0.1
0.2
Output
0.30000000000000004
0.3
True

Sample 2

Input
0.15
0.15
Output
0.3
0.3
True
solution.py
Output appears here
Floating Point Surprise · Python practice problem · LearnPy Hub