[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Bug with math.log
- From: Dirk Laurie <dirk.laurie@...>
- Date: Tue, 4 Mar 2014 15:53:47 +0200
2014-03-04 14:46 GMT+02:00 Dio Darkclainer <darkclainer@gmail.com>:
>>> 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)
Interesting.
The same applies to
for i=1,20 do
if math.log(2^i) ~= i*math.log(2) then
print(i)
end
end
I.e. the correctly rounded values of math.log(2^i) and i*math.log(2)
are always equal. That requires some explanation, not the fact that
math.log(2^i,2) does not always evaluate to exacly i.