lua-users home
lua-l archive

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


On Thu, Dec 19, 2013 at 12:37 PM, Coda Highland <chighland@gmail.com> wrote:
 On Thu, Dec 19, 2013 at 7:00 AM, Oliver Kroth <oliver.kroth@nec-i.de> wrote:
>>> If that is a problem, try
>>>         local nan_value = math.sqrt(-1)
>>> or
>>>         local nan_value = math.asin(2)
>>
>>
>> Math magic >.>
>>
>> Reveal your secrets, wizard!
>>
> No number x can solve x*x = -1, so its solution is not a number NaN...
> Same with asin(2). No number x solves 2 = sin(x)

Until someone swaps out the math library for one that supports complex
numbers...

/s/ Adam


Actually, I'm surprised sqrt(-1) and asin(2) don't also raise exceptions. Are these conditions checked for?

--
Sent from my Game Boy.