-->
Page 1 of 1

trouble dealing with floatingpoint numbers

PostPosted: Tue Oct 27, 2015 2:32 pm
by MHz
I'm using: NodeMCU 0.9.5 build 20150318 powered by Lua 5.1.4

While dealing with floatingpoint numbers I get just integers as result as in
> print(10/3)
3

or error messages like
> print(10.456)
stdin:1: malformed number near '10.456'

> print(tonumber("123.456e5"))
nil
Whats wrong, what do I miss?
Thank you!

Re: trouble dealing with floatingpoint numbers

PostPosted: Tue Oct 27, 2015 3:51 pm
by jankop
You loaded a integer version of Lua. Load float...

Re: trouble dealing with floatingpoint numbers

PostPosted: Wed Oct 28, 2015 2:28 am
by MHz
Hi Jankop, thank you for the hint. Question remains where I will find the floatingpoint version of Lua for mcunode - I#m a newbie.

Thanks a lot
MHz