There are built-in functions: How to get the significand and the exponent of a floating point number?