forked from micropython/micropython
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Labels
Description
CircuitPython version
Adafruit CircuitPython 7.1.0-rc.1 on 2021-12-25; Raspberry Pi Pico with rp2040Code/REPL
>>> 23.40 * 100
2340.0
>>> int(23.40 * 100)
2339Behavior
The floating point version is 2340.0 and when cast to int becomes 2339. This works fine in regular python:
Python 3.9.7 (default, Sep 10 2021, 14:59:43)
[GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 23.40 * 100
2340.0
>>> int(23.40 * 100)
2340Description
Without knowing the implementation details, the problem reminds me of issues I've seen related to IEEE 754 elsewhere.
Additional information
No response