[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: math package floating point exceptions
- From: "Alex Davies" <alex.mania@...>
- Date: Sat, 29 Mar 2008 11:51:44 +0900
Hi James,
What that means is that your host app has floating point exceptions enabled.
By default, the fpu should just produce propagating NaNs and Infs. Perhaps
you're running inside Delphi or similar? Anyway, to disable floating point
exceptions.
On an x86 where __asm{} allows you to type assembler, this'll do it:
__asm {
finit;
}
(Reinitializes the fpu to its default state)
Then your application will run this app:
print(math.asin(5))
The same as the lua standalone, that is, it'll print NaN;
----- Original Message -----
From: "James Walker"
When Lua is used on Windows, floating point exceptions can crash the host
application. I suggest adding some error checks, something like this: