Skip to content
Bugwise
Menu

Floating-point error

Also called: Rounding error

Tiny rounding errors because computers can't store some decimals exactly.

Definition

0.1 + 0.2 gives 0.30000000000000004 in most programming languages. Values must be rounded before display or comparison, especially money and ratings.

In practice

A rating filter shows '★ 3.5000000000000004+', and a 4.8-star product is filtered out at 4.8.

Related terms

Esc

Type to search the whole site.