Does big number calculate has bug in ESP8266 board?

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
shaoziyang
Posts: 363
Joined: Sun Apr 17, 2016 1:55 pm

Does big number calculate has bug in ESP8266 board?

Post by shaoziyang » Wed Jun 22, 2016 7:56 am

Does big number calculate has bug in ESP8266 board? I calculate 44*55 in ESP8266 and STM32L476DISC, the result is different.

In ESP8266:

MicroPython v1.8.1-81-g6b088a6 on 2016-06-20; ESP module with ESP8266
Type "help()" for more information.
>>> 44**55
24541279788272642710876651734897621278680174612083477162383185691311496161944044
>>>

In STM32L476DISCO:

MicroPython v1.8.1 on 2016-06-12; L476-DISCO with STM32L476
Type "help()" for more information.
>>> 44**55
24541279788272642710876651734897621278680174612083477162383185691311496161944046
94280372224
>>>

shaoziyang
Posts: 363
Joined: Sun Apr 17, 2016 1:55 pm

Re: Does big number calculate has bug in ESP8266 board?

Post by shaoziyang » Wed Jun 22, 2016 8:12 am

When I use hypertrm in windows it may cuase this porblem, but when I use putty, result is correctly.

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Does big number calculate has bug in ESP8266 board?

Post by pythoncoder » Wed Jun 22, 2016 8:35 am

My guess (and it is just a guess: I don't use Windows) is that it's a terminal artefact. It looks to me as if Hyperterm is set to 80 columns and isn't handling line wrap. It displays 80 characters correctly, but then puts subsequent characters in the rightmost column, repeatedly overwriting column 80. Compare your erroneous result with the correct result from CPython and ESP8266.
Line 1: erroneous result
Line 2: CPython on Linux
Line 3: ESP8266 via Miniterm on Linux

Code: Select all

24541279788272642710876651734897621278680174612083477162383185691311496161944044
2454127978827264271087665173489762127868017461208347716238318569131149616194404694280372224
2454127978827264271087665173489762127868017461208347716238318569131149616194404694280372224
Both are identical up to column 79. Your erroneous result has the final digit of the correct result in column 80.
Peter Hinch
Index to my micropython libraries.

Post Reply