Home About Us Services Free SW Contact us

AVR floating point library for gcc

This page contains a floatpoint arithmetics library for the ATmega chips in the AVR family. The library is a substitute for the one that comes with gcc. If you link this library to your code, then the functions in this library will take the place of the gcc provided floatpoint runtime. The functions in this library are both smaller and significantly faster than what comes with gcc. The functions, just like gcc's own, follow the IEEE-754 specifications, so there is no loss of precision by using this library. In addition, a few handy float functions that are not provided by gcc are also provided. Please read the README file, you will find the details as well as useful information about gcc's handling of floats.

Please note that this library is a replacement for gcc's runtime library functions. Apart from sqrt() it does not have any transcendental functions, so do not expect to find a full math library here. If you need sin(), cos(), exp(), ln() et al, you need to find them somewhere else. However, if you find them, using this library will make them run faster.

This library is free software, it has been released under the BSD license. Consequently it comes with no warranty at all. The BSD license allows you to use this library in a proprietary, closed source product and you do not have to release either your code or any modifications you make to the library (although if you improve the library, you are encouraged to publish your enhancements) but you have to credit us for writing this library. For details see the LICENSE, included in the source distribution.

This library is intended to be used with gcc version 4.0.x (or later) although as far as we know, it also works with 3.4.x. You can compile it on any system as long as you have the avr-elf gcc crosscompiler installed with the matching binutils package. You will also need GNU make. The code uses gcc specific features, so it is unlikely that it would be useful with any other compiler.

Current Stable Version

This is V1.0 (last modified on 2007 June 15). First public release.


The README file in the source distribution contains everything you need to know as a user. The source files have ample comments if you want to modify the functions.


Unpack the source, read the README, possibly edit the Makefile then type make. Then copy the resulting library to wherever you want to use it. You have to also copy a header file that contains the prototypes for the extra functions.


avr-gcc-float-1.0.tgz, the source of the library a gzipped tar file, 31KB.

Known Bugs and Issues

None known.