Mail Archives: djgpp/1999/01/14/16:47:51
Horst Kraemer wrote :
>
> The problem is that the long double value you specified:
>
> A33A 6F....
> exp significand
>
> is an 'unnormal', i.e. a FP number where bit #63, the implied 1.0 of
I know, that the value might be invalid. It is not an constructed
example but it comes from real live. I simply thought, that the
doprnt() function should handle this, which it doesn't. I came
to this, when I read out the FPU stack and then print the contents.
And if a FPU register is not used, it might have such a value in it.
> In order to circumvent the problem you may load the value to a ld
> variable and perform an operation like
>
> long double ld;
>
> ld = *(long double*)i;
> ld+=0;
>
> Now your sprintf will produce the output 'NaN' because the operation
> produces a NaN.
Thanks for that hint. I'll try this and if it fixes it, I'll
use it.
Robert
--
******************************************************
* email: Robert Hoehne <robert DOT hoehne AT gmx DOT net> *
* Post: Am Berg 3, D-09573 Dittmannsdorf, Germany *
* WWW: http://www.tu-chemnitz.de/~sho/rho *
******************************************************
- Raw text -