Search found 4 matches

by Filip
Wed Jan 19, 2022 2:32 pm
Forum: General Discussion and Questions
Topic: Very low int rounding error on Raspberry Pico
Replies: 4
Views: 7539

Re: Very low int rounding error on Raspberry Pico

It's not round it's print ;).

Code: Select all

if 66.3 == round(66.30001, 1):
    print("Rounding is fine")
print("This should not print 66.30001 on Pico but it does:", 66.3)
by Filip
Wed Jan 19, 2022 2:27 pm
Forum: General Discussion and Questions
Topic: Micropython UART doesn't work on Picos RP2040
Replies: 15
Views: 13414

Re: Micropython UART doesn't work on Picos RP2040

Some info is missing: How did you connect both UART-s?
by Filip
Wed Jan 19, 2022 2:24 pm
Forum: General Discussion and Questions
Topic: Calculate percent value
Replies: 13
Views: 31117

Re: Calculate percent value

Maybe I should have said "decimal" places. Especially with 1-wire measurements and using round 1 on the returned floating point number, I would often get: 66.4 66.30001 66.2 FYI: I learned this today: if 66.3 == round(66.30001, 1): print("Rounding is fine") print("This should not print 66.30001 on ...
by Filip
Mon Jan 17, 2022 5:53 pm
Forum: General Discussion and Questions
Topic: Very low int rounding error on Raspberry Pico
Replies: 4
Views: 7539

Very low int rounding error on Raspberry Pico

Hi there. First congrats for 1.18. I'm very happy and gratefull but very fresh member of MicroPython coders community. I have some rounding errors in my outputs so I dig into it. I know floats are nasty with very limited resources but this feels too soon. print("This should not print 66.30001 on Pic...