lua-users home
lua-l archive

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


Given that this subject comes up every couple of months, and that there are some subtleties to it, that this warrants a new function in the math library to do it the right way?

On Aug 10, 2013, at 9:04 AM, Coda Highland <chighland@gmail.com> wrote:

> On Sat, Aug 10, 2013 at 12:48 AM, Enrico Colombini <erix@erix.it> wrote:
>> On 10/08/2013 0.47, Coda Highland wrote:
>>> 
>>> Ah, whoops, yeah, you're right, I got sloppy there. Really that ought
>>> to be epsilon*math.max(lhs,rhs) even.
>> 
>> 
>> Do you mean epsilon*math.max(math.abs(lhs),math.abs(rhs)) ?
>> 
>> --
>>  Enrico
>> 
> 
> No, but you have a good point that it should be math.abs(epsilon*rhs).
> 
> /s/ Adam
>