[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua 5.3: Should min/max return a float, if it is given integer?
- From: Coroutines <coroutines@...>
- Date: Wed, 4 Jun 2014 17:38:59 -0700
Speaking as someone who doesn't understand the science behind the
integer<->float conversion for various operations, my interpretation
has been thus:
When precision "can" be lost to represent a number as an integer, it
is. Operating on integers always seems to be faster than operating on
floats/doubles so I understood this to be the motive behind
introducing integers in 5.3 "where they can appear".
2.5 + 2.5 + 2 -> 2.5 + 2.5 + 2.0 -> 5.0 + 2.0 -> 7.0 -> 7