Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what languages get IEEE 754 right?

Tags:

ieee-754

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 were 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: are there languages out there (appart from C/C++ or raw assembly) that give me access to rounding modes, exception flags and calculus ?

like image 772
nraynaud Avatar asked Apr 04 '09 01:04

nraynaud


1 Answers

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.

like image 127
Joachim Sauer Avatar answered Nov 14 '22 19:11

Joachim Sauer