AI engineering glossary · Python core

What is float?

Float (also called floating-point number): A number with a decimal point, stored as a binary floating-point value of type float. Floats are approximate because many decimal fractions cannot be represented exactly in binary, so tiny rounding errors appear in comparisons.

Level: beginnerTopic: Python core

Float: an example

0.1 + 0.2 gives 0.30000000000000004, so use math.isclose(0.1 + 0.2, 0.3) instead of == when comparing.

Related terms

More Python core terms

Where you learn it

Float is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.