New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
conversation float to int on MCU #4035
Comments
The esp8266 only has 30 bits of precision for a float, so there is loss of precision here. Instead, try to use truncating integer division: |
It's most likely caused by the limited significant digits in a float operation. You should get the expected result by |
Thanks, that works. This could be documented in differences that it works like C not like CPython. Resp. that not works like C, here we could get overflow number, not still the same. |
It used to always return None. Fixes micropython#4035
Hi, i see some magic int / float operations on MCU. I want to get timestamp aligned to minutes on ESP8266. Here is output from console:
I test in on your web unicorn and here is output:
Unix port works OK:
When i do this more-time on ESP, the first number is still same:
firmware on ESP8266: esp8266-ota-20180511-v1.9.4.bin
Later i would to test it on STM32F4 Discover and on ESP32.
The text was updated successfully, but these errors were encountered: