lua-users home
lua-l archive

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


Roberto Ierusalimschy wrote:
> 
> > Just define your own rules that are valid on every system; i.e. raise
> > an error on an unordered comparison (that's even a requirement in IEC
> > 60559). To help math-geeks you could provide C-like "non-signaling"
> > methods like isgreater, isgreaterequal, isnan, isnormal, ... in the
> > math-lib.
> 
> How to implement that in ANSI C?

These functions/macros are part of ANSI-C99.

Creating useful ANSI-C89 math semantics my be really difficult.  Most
(all?) float stuff seems to be implementation dependent there.

If you want to strictly stick to ANSI_C89 just forget about NaNs, Infs,
and so on and say that working with these values is system/implementation
dependent.

Ciao, ET.

PS: I don't have C89 here; and only the C99 draft...