I am trying to invert the exponent of a long double.
Suppose x = 3.5e1356. I want x to be 3.5e-1356.
I have this code:
long double x = 3.5e1356L;
int exponent;
long double fraction = frexpl(x, &exponent);
// recreate number with an inverted exponent
long double newNumber = ldexpl(fraction, -exponent);
after this code, newNumber
is 1.14732677619641872902e-1357
that has nothing to do with the original number.
What am I missing?