Fix: write float/double floating point numbers

Casting them to unsigned integers does not keep the
IEEE 754 format.
Add examples