More instantiation problems under hpux
Gabriel Dos Reis
gdr@codesourcery.com
Wed Jan 16 23:12:00 GMT 2002
"John David Anglin" <dave@hiauly1.hia.nrc.ca> writes:
[...]
| The functions isinf and isnan don't exist on the VAX because the floating
| point hardware doesn't support the special values values inf and nan.
| The function strtod returns HUGE (-HUGE) if the conversion would overflow,
| or 0 is the conversion would underflow. HUGE is the same as HUGE_VAL
| unless you muck with _POSIX_SOURCE. errno is set to ERANGE if the correct
| value is outside the range of values that can be represented. I
| probably can find info about the rounding/truncation when doubles are
| converted to floats.
Well, I will appreciate if you could provide more on that, for the
simple reason that I'm now working on numeric_limits<> support for
floating point. I need to have as much as info as possible in order
to set up a general framework as we do for integer types.
| HPUX has isinf and isnan. The function strtod behaves similarly to
| the VAX ultrix function.
|
| I'm thinking that in the float case, the result would be ok if the
| double obtained from strtod is in the range [FLT_MIN, FLT_MAX] when
| positive. Similarly, negative values should be in the range
| [-FLT_MAX, -FLT_MIN]. The comparisons are possible because
| FLT_MIN > DBL_MIN and FLT_MAX < DBL_MAX. Don't know if this is
| true for all FP hardware but it should work for ieee and vax.
The C language (therefore the C++ language) requires the conversion
float -> double be lossless, so the above constraints must hold (with
large inequalities, instead of strict ones)
| You have to get these values from float.h. There are some silly
| values for FLT_MIN and DBL_MIN in limits.h on vax ultrix.
Are they depend? Under which conditions?
-- Gaby
More information about the Libstdc++
mailing list