For the reals.c Implementation i have used some code from MLtons Implementation of the IEEEEreals.
I think Mac OS X now supports the fpsetround/fpgetround calls in /usr/include/fenv.h .
It does. MLton only uses the code Martin referenced on platforms that do not yet support fp{g,s}etround, namely, Cygwin, NetBSD, and OpenBSD.
BTW, MLton is released under a BSD-style license, so you can include code in other projects, provided you keep the copyright notice and don't use NEC's name for publicity without permission. See