[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
**Subject**: **Re: catching divide by zero**
**From**: Coda Highland <chighland@...>
**Date**: Thu, 19 Dec 2013 09:37:39 -0800

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