-->
Page 1 of 3

Deactivation of floats in future LUA versions.

PostPosted: Fri Jan 30, 2015 3:02 am
by Hans174
I suggest to deactivate float in future LUA versions.

There are side effects like the issue with "string.format".

Integer calculation in older programs doesn't work any more.
- float enabled 600 / 70 = 8.571428571
- float disabled 600 / 70 = 8

There could be more undiscovered issues.

What do you think?

Re: Deactivation of floats in future LUA versions.

PostPosted: Fri Jan 30, 2015 7:19 am
by jankop
I'm against it. If not rise significantly memory requirements of programs, so it is clearly beneficial. I even edited the first program for FP.

> =(600-600%70)/70
8
>

:D

Re: Deactivation of floats in future LUA versions.

PostPosted: Fri Jan 30, 2015 9:23 am
by sej7278
have you tried building nodemcu from source after the 27th, as there's now a LUA_NUMBER_INTEGRAL macro to disable floats at compile time, and also a string.format() fix:

https://github.com/nodemcu/nodemcu-firm ... its/master

i'd rather they fixed the issues and left floats enabled, although they're not much use without the Math library.

Re: Deactivation of floats in future LUA versions.

PostPosted: Fri Jan 30, 2015 12:33 pm
by jra
I'd rather have floats enabled by default and modify the example code accordingly.