Mail Archives: djgpp-workers/2003/03/18/03:39:30
Eli said:
> I think we should at least verify that <anything> is a hex number.
Nope. Or at least probably not. Because the highest hex number we can
read is an unsigned long long. That covers the mantissa of a long
double. Where should the sign bit be indicated?
Lately I've been thinking "nan(s,m,e)" while printing and with the
",e" part optional while scanning (it'll be ignored anyway). s ==
sign, m == mantissa, e == exponent.
Or we could always omit "e". I just thought it nice to give the user
the whole story.
> Ideally, we should also generate the precise bit pattern as given by
> <anything>. It cannot be too hard.
Yes. All we need to agree on the format and if somebody else does the
printing part, I'll do the strto{f,d,ld}() part.
> Btw, what does C9x say about <anything> that specifies a bit pattern
> which is not a NaN?
I don't have the standard here but I'm pretty certain it must
generate a NaN. That's why the "e" above will be ignored. And if "m"
is 0, set it to some other documented non-zero value (otherwise we'd
get Inf).
Right,
MartinS
- Raw text -