[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
**Subject**: **Re: [UNSURE]Re: log/log10 in Lua 5.2.0-alpha**
**From**: Vaughan McAlley <vaughan@...>
**Date**: Mon, 23 May 2011 13:17:00 +1000

On 21 May 2011 17:11, François Perrad <francois.perrad@gadz.org> wrote:
> 2011/5/20 Dirk Laurie <dpl@sun.ac.za>
>>
>> >
>> > I don't understand the rational of the removal of math.log10 and the
>> > addition
>> > of optional second parameter in math.log
>> Maybe because there is no longer any strong reason why base 10 is
>> any more special than base 2 or whatever.
>>
>> >
>> > It's a general implementation of log, but all opportunities of
>> > optimization
>> > are lost.
>>
>> If you have an application that calculates logarithms base 10 so often
>> that the unoptimized implementation slows it down unacceptably — then
>> you write a very short module in C that supplies log10 directly.
>
> I know that.
> But my point is that I think this evolution between 5.1 and 5.2 is not an
> improvement.
I think being able use any base besides e and 10 is an improvement.
Maybe I will miss working out from first principles how to calculate
log2, but I doubt it!
Vaughan