tags:

views:

264

answers:

3

Hi all,

I just spend my week messing with the subject, and found no language that get the IEEE 754 spec right.

Even GCC doesn't respect the relevant C99 part (it ignores the FENV_ACCESS pragma, and I've been told than my working examples where sheer luck).

It is impossible (AFAIK) to respect the spec with library functions, you need support from the language because some common optimizations are forbidden when you play with flags or rounding.

So here is my real question: is there languages out there (appart from C/C++ or raw assembly) that can give me access to rounding modes and exception flags and calculus ?

A: 

AFAIK, even FPU hardware units do not implement the complete IEEE-754 spec entirely. So, depending on what you need, you may be out of luck trying to get it. Maybe that is why no languages get it entirely right.

sybreon
the sowtware traps were created for this: you can call a software to finish the work the FPU doesn't. I think this is the way subnormal are generated.
nraynaud
+2  A: 

Since you're talking about the "hard" parts of IEEE 754, I'd guess your best bet would be to use Fortran. According to the Wikipedia article Fortran 2003 supports floating point exception handling at least.

Joachim Sauer
A: 

I looks like Factor does it, and the link claims that D an SBCL too.

nraynaud