Logo

Programming-Idioms

History of Idiom 79 > diff from v30 to v31

Edit summary for version 31 by programming-idioms.org:
[Lua] Typo in comments

Version 30

2018-04-03, 08:40:41

Version 31

2018-04-03, 22:28:36

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
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
Comments bubble
While + .0 makes no difference inside the language, 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
Doc URL
https://www.lua.org/manual/5.3/manual.html#2.1