lua-users home
lua-l archive

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


Am 14.04.2014 12:28 schröbte Thomas Jericke:

The power operater can either be:
float ^ float -> float
int ^ int -> int

or

float ^ float -> float
int ^ int -> number

Where number is defined as (float | int).

I am not conviced by either option. The most consistent IMO would be an
additional ^^ (int exponent) operator, and apply the same rules for
power as for division.

Or maybe `math.pow` and `math.ipow`. This way you can be explicit if you need a certain overflow behavior.


--
Thomas


Philipp