lua-users home
lua-l archive

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


> > There's a difference here: tmpnam *cannot* be used in a secure way in
> > general. acos can. Further, most systems allow the floating-point exception
> > behaviour to be specified, and C'99 standardises this behaviour.
> >
>
> Hmmm... C99, which almost nobody uses today, standises this behaviour.  So,
> anyone who is using floating-point exceptions today is using them in a
> non-portable way and shouldn't be using them in conjunction with ANSI
> functions, right?  (see below)

Yes, you're quite right. There *is* no C'89 notion of floating-point
exceptions. The behaviour of the floating point functions outside their
domains is undefined. It's the caller's responsibility to check that
arguments passed to those functions are within range.

> Get ISO C to change them then.  lua is a small, easily embedded in a C
> program, language, not a Software Engineering Campaign to correct all
> that is broken in the world.

Lua aims to present a predictable, and where possible, safe environment.
It's designed for portability and (at one end of a spectrum) use by
non-programmers or novice programmers. Much of the ANSI C library is
entirely portable and robust, so there's no point in exposing the few parts
that aren't.

> Why is that?  The ANSI function has functionality I require and is well
> tested.  Using a function in this way is preferable to writing something
> from scratch.

On the contrary, the *ANSI* function has no such functionality. Some
implementations of it do. Indeed, when that's suitable, use it. But don't
expect Lua to provide an interface to it.

-- 
http://sc3d.org/rrt/ | Caution Children At Play Drive Slowly