add safe_float functions

* modified versions of safe_float functions suggested by Pascal

* include float.h when --float is passed

* should have mentioned in previous commit: floating point support
is disabled by default, passing --float to enable it