Misc functions to work with floating point numbers