[Issue 1881] New: feqrel nonsensical for two identical float arguments
    d-bugmail at puremagic.com 
    d-bugmail at puremagic.com
       
    Fri Feb 29 00:39:35 PST 2008
    
    
  
http://d.puremagic.com/issues/show_bug.cgi?id=1881
           Summary: feqrel nonsensical for two identical float arguments
           Product: D
           Version: 2.011
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: clugdbug at yahoo.com.au
        ReportedBy: clugdbug at yahoo.com.au
Given
float a;
assert(feqrel(a,a) == real.mant_dig);
which is nonsensical; the return value should never exceed the precision of the
arguments. Should be float.mant_dig.
The solution is to turn feqrel into a template, and require both arguments to
be the same type.
-- 
    
    
More information about the Digitalmars-d-bugs
mailing list