|
|
|
|
|
by actionfromafar
556 days ago
|
|
Maybe OP reacted because a float only looks like it is a way to store decimal numbers, when it's only an approximation of decimal numbers. If you really need decimal numbers you need something like mpmath¹. As a shorthand to explain what a float is to someone, "a decimal number" is an OK start though. But sometimes that approximation breaks down even for simple examples, i.e. 0.1 cannot be represented as a float. This can be quite unexpected if your mental model is that "floats are decimal numbers with a certain precision". 1: https://mpmath.org/ |
|