nodemcu / nodemcu-firmware

Lua based interactive firmware for ESP8266, ESP8285 and ESP32
https://nodemcu.readthedocs.io
MIT License
7.67k stars 3.13k forks source link

math.floor doesn't support 64bit number #3407

Closed vidalouiswang closed 2 years ago

vidalouiswang commented 3 years ago

Expected behavior

math.floor(1615401512363 / 36) = 44872264232

Actual behavior

math.floor(1615401512363 / 36) = 2147483647

Test code

Provide a Minimal, Complete, and Verifiable example which will reproduce the problem.

-- add code here
print(math.floor(1615401512363 / 36) == 44872264232)

NodeMCU startup banner

NodeMCU 3.0.0.0 branch: release commit: 136e09739b835d6dcdf04034141d70ab755468c6 release: 3.0.0-release_20210201 release DTS: 202102010145 SSL: true build type: double LFS: 0x40000 bytes total capacity modules: adc,adxl345,bit,bme280,crypto,dht,encoder,file,gpio,gpio_pulse,http,hx711,i2c,net,node,ow,pcm,pwm,pwm2,rfswitch,rotary,rtcfifo,rtcmem,rtctime,sjson,sntp,softuart,spi,switec,tls,tmr,uart,u8g2,websocket,wiegand,wifi,wps

build 2021-03-10 18:25 powered by Lua 5.3.5 on SDK 3.0.1-dev(fce080e)

Hardware

I'm using the NodeMCU ESP8266.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.