lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Ariel Manzur kirjoitti 25.3.2008 kello 23:03:
On Tue, Mar 25, 2008 at 5:51 PM, Asko Kauppi <> wrote:

Ariel Manzur kirjoitti 25.3.2008 kello 22:06:

On Tue, Mar 25, 2008 at 10:55 AM,  <> wrote:
Before 2008, I used to have LNUM patch always return FP
results to an integer, if possible. This, however, slowed
down _all_ FP operations slightly, and was never feeling
'right'. The current way does feel right for me, and I bet

Is it possible to disable conversion from integers to FP too? (maybe
with a compile time option).

You mean to give an overflow error, or a round trip to negative

No, I mean have it behave like this:

5 / 2 = 2
5.0 / 2 = 2.5
2.5 * 2 = 5.0

like C basically, with no behind-the-scenes conversions at all.

LNUM patch was made to be 100% compatible with Lua. This wouldn't be and I'm personally very happy with the "all numbers are just numbers" way that Lua treats them.

If you really really want this, it can be done with syntax modders, but it won't be Lua any more. In my opinion.