ProgrammingVery hardJEE Advanced · CAT placement

What is printed?

What is printed?
print(5e-324 / 2 == 0, 2e-323 > 5e-324, float('1e-400'), 5e-324 / 2 == 0.0)
  1. A. False True 0.0 True
  2. B. True False 0.0 True
  3. C. True True 1e-400 False
  4. D. True True 0.0 True

Correct answer: D. True True 0.0 True

5e-324 is the smallest positive double. Half of it is exactly halfway to zero, and round-half-to-even sends it to 0.0. Any decimal below the smallest subnormal also underflows to 0.0.

More Python Programming questions

Exams that ask this topic