?

AP® Computer Science Principles

Free Version

Upgrade subject to access all content

Moderate

Computer Can't Subtract

APCSP-FKVNWC

When working with the programming language Python, Clinton noticed something strange. When he subtracted 0.1 from 0.3 he did not see the result 0.2 that he expected. Instead, he saw

>>> 0.3 - 0.1
0.19999999999999998

This is likely the result of

A

an overheated processor making small errors.

B

a fixed number of bits representing floating point values, leading to small errors.

C

a bug in the Python language.

D

the inevitability of computers taking over and making complex decisions on their own.