[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Floating point exceptions
- From: Reuben Thomas <rrt1001@...>
- Date: Sun, 7 Jan 2001 00:33:27 +0000 (GMT)
First, please correct me if I'm wrong, but it seems from K&R second edn that
the behaviour of ANSI C '89 on floating point division by zero is undefined.
Am I correct?
The reason I ask is that I came across the problem in my EPOC port of Lua
that by default EPOC traps division by zero. I was able to turn it off, but
this meant I had to add an initialisation function, which is called (in my
port) by main() in lua.c, but in a cleaner implementation should be called
from within the Lua library (perhaps?).
I know that the C'99 standard gives access to the floating point state via
fenv.h, so perhaps this should be considered moot, but I was wondering if it
would be worth having some sort of standard hook (either in lua.c, or in
lua_open, but this is trickier) for system-specific initialisation of this
http://sc3d.org/rrt/ | wit, n. educated insolence (Aristotle)