If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Number limits, overflow, and roundoff

Problem

A scientist is running a program to calculate the volume of a cone:
radius ← 17.24
height ← 5.24
volume ← PI * (radius * radius) * (height / 3)
The code relies on the built-in constant PI. After running the code, the variable volume stores 1630.9266447568566.
Their supervisor checks their results by running the same calculation on their own computer. Their program results in a volume of 1630.9266447564448.
The two values are very close, but not quite the same.
Which of these is the most likely explanation for the difference?
Choose 1 answer:
🤔