add some functions copied from unit_test_single for mantissa/exponent handling