Re: integer exponentiation with negative exponent
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: integer exponentiation with negative exponent
- From: Dirk Laurie <dirk.laurie@...>
- Date: 2014年4月14日 09:53:29 +0200
2014年04月14日 9:29 GMT+02:00 Tim Hill <drtimhill@gmail.com>:
> .. it really comes down to two choices:
>
> 1 / (x^(-n) … invert the sign and do floating point division
> -or-
> error
>
> As Roberto said, work1 did the former, work2 the latter.
>From a pedantic point of view, inverting the sign and doing
integer division is the only consistent option.
But from a practical point of view, particularly the non-breaking
of existing programs, floating-point division is the only useful
option.
So which is more typical of The Lua Way: consistent but useless,
or pragmatic and useful?
— Hobgoblin Emerson