[Bug libstdc++/11099] New: wrong values for numeric_limits<double>
franky.backeljauw@ua.ac.be
gcc-bugzilla@gcc.gnu.org
Thu Jun 5 08:52:00 GMT 2003
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11099
Summary: wrong values for numeric_limits<double>
Product: gcc
Version: 3.2.2
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: libstdc++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: franky.backeljauw@ua.ac.be
CC: gcc-bugs@gcc.gnu.org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu (redhat-linux-9, gcc version 3.2.2,
intel pent
GCC target triplet: i386-pc-linux-gnu
Hello,
could there be an error in the values of the numeric_limits<double>
specification? It gives me (Intel, RH9) the following values
<snip>
TYPE = double
is_specialized = 1
radix = 2
digits = 53
digits10 = 15
is_signed = 1
is_integer = 0
is_exact = 0
min = 2.22507e-308
max = 1.79769e+308
epsilon = 2.22045e-16
round_error = 1
min_exponent = -1021
max_exponent = 1024
min_exponent10 = -307
max_exponent10 = 308
is_iec559 = 0
is_bounded = 1
is_modulo = 0
traps = 0
tinyness_before = 0
</snip>
I found some documentation on the "numeric_limits" class which states that
<snip>
max_exponent = Maximum positive integer such that the radix raised to
that power is in range.
min_exponent = Minimum negative integer such that the radix raised to
that power is in range.
</snip>
This would mean that both values are wrong according to both the IEEE 854
standard as well as the definitions given above. Using the definition,
min_exponent should for instance be -1022 - 52 or -1074 for the double type,
whilst using the standard it should be just -1022. max_exponent should in both
cases be 1023.
Also, is_iec559 is false, which would mean that the type is not IEEE 854 compliant?
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
More information about the Gcc-bugs
mailing list