Berkeley SoftFloat is a free, high-quality software implementation of binary
floating-point that conforms to the IEEE Standard for Floating-Point
SoftFloat is completely faithful to the IEEE Standard, while at the same time
being relatively fast.
All functions dictated by the original 1985 version of the standard are
supported except for conversions to and from decimal.
The latest release of SoftFloat implements five floating-point formats:
SoftFloat is distributed in the form of ISO/ANSI C source code and should be
compilable with almost any ISO-compliant C compiler.
Using the GNU C Compiler (
gcc), the package has been compiled and
tested for several platforms.
Target-specific code is provided for various Intel x86 processors.
Other machines can be targeted using these as examples.
The latest version of SoftFloat is
The following archive contains all source code and documentation for
The older Releases 3a and 3b are still available here:
For those who may need it, SoftFloat versions preceding
Once compiled, SoftFloat can be tested using the
program of Berkeley TestFloat:
|Berkeley TestFloat is a small collection of programs for testing that an implementation of binary floating-point conforms to the IEEE Standard for Floating-Point Arithmetic.|
The following table shows the speeds of some of SoftFloat's functions on
machines of different strengths.
For this table, SoftFloat was compiled using the GNU C Compiler with only
ordinary optimization enabled
1-GHz ARM Cortex-A8 (32-bit),
32-kB I/D caches, Linux, GCC 4.6.3
Linux, GCC 4.8.5
(floating-point) directory of the
Freely Distributable LIBM
(fdlibm), an implementation of the
|Sun Microsystems' Numerical Computation Guide, which covers the IEEE Standard in detail. (Sun Microsystems was acquired by Oracle in 2010.)|
|My article “Handling floating-point exceptions in numeric programs,” explaining how the exception handling features of the IEEE Standard can be applied to real programs.|
Berkeley SoftFloat was written by me,
John R. Hauser.
Funding for the development of SoftFloat
Bugs in SoftFloat and other comments can be reported to me at