[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
**Subject**: **Re: Bug with math.log**
**From**: Dio Darkclainer <darkclainer@...>
**Date**: Tue, 4 Mar 2014 16:46:14 +0400

2014-03-04 16:36 GMT+04:00, Dirk Laurie <dirk.laurie@gmail.com>:
>
> The C code in lmathlib.c says:
>
> res = l_mathop(log)(x)/l_mathop(log)(base)
>
> There is nothing special about base=2, so you get the
> usual implementation-dependent errors.
>
> If Lua allowed itself the use of C99, we could have had
>
> res = l_mathop(log2)(x)/l_mathop(log2)(base)
>
> which would be exact.
>
>> if use math.log(2^i)/math.log(2) instead all work correctly
>
> Does it continue working correctly if you increase the upper
> bound of the loo[?
Work correctly with all number up to upper bound (if you mean 2^1023)