8949 – numeric_limits<>::denorm_min() and is_iec559 problems. (original) (raw)

| I found some problems with numeric_limits class: 1. In case denormalization is not presented (numeric_limits<>::has_denorm == false) numeric_limits<float;double;long double>::denorm_min() should be equal to corresponding numeric_limits<float;double;long double>::min(). (minimum positive normalized value, see ISO|IEC 14882 14882 "C++" 18.2.1.2(49-51)) As an effect there is: 2. numeric_limits<float;double;long double>::denorm_min() should be > 0.0 as stated in ISO|IEC 10967-1 "Language Independend Arithmetic" (see also ISO|IEC 14882 "C++" 18.2.1.2(49-51)) 3. Possibly I am wrong here, but please look also for is_iec559 member for short,int,long types, it looks that these types shouldn`t have it set to true. See small testcase attached also. Release: gcc version 3.2 20020903 (Red Hat Linux 8.0 3.2-7) Environment: Red Hat Linux 8.0 How-To-Repeat: Compile and run testcase with g++. You`ll see some failed messages. Comment 1 Paolo Carlini 2002-12-15 10:55:46 UTC Responsible-Changed-From-To: unassigned->paolo Responsible-Changed-Why: Analyzed. Comment 2 Paolo Carlini 2002-12-15 10:55:46 UTC State-Changed-From-To: open->analyzed State-Changed-Why: First half (denorm_min()), already fixed for 3.3, it isn't a regression and probably the fix will not be backported to 3.2.x. Second half (is_iec559), confirmed everywhere as a bug in my reading (see 18.2.1.2, 53 and 18.2.1.5, 1), easy to patch as soon as the mainline reopens. Comment 3 Paolo Carlini 2002-12-16 11:56:40 UTC State-Changed-From-To: analyzed->closed State-Changed-Why: Fixed for 3.3 and 3.4. | | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |