Logo

Programming-Idioms

History of Idiom 79 > diff from v28 to v29

Edit summary for version 29 by Kng:
New Lua implementation by user [Kng]

Version 28

2018-03-02, 17:01:18

Version 29

2018-04-03, 08:39:43

Idiom #79 Convert integer to floating point number

Declare floating point number y and initialize it with the value of integer x .

Idiom #79 Convert integer to floating point number

Declare floating point number y and initialize it with the value of integer x .

Code
y = x + .0
Comments bubble
While _+ _.0 makes no difference inside the langauge it will flag it as a fractional number in the C runtime
Doc URL
https://www.lua.org/manual/5.3/manual.html#2.1