[Issue 3240] New: std.numeric.findRoot only works with real

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Aug 10 03:04:37 PDT 2009


http://d.puremagic.com/issues/show_bug.cgi?id=3240

           Summary: std.numeric.findRoot only works with real
           Product: D
           Version: 2.031
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: major
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: bugzilla at kyllingen.net


Trying to use std.numeric.findRoot with other types than real gives template
instantiation errors originating from lines 599 and 560 in numeric.d (DMD
2.031, SVN rev. 1200):

  599   if (a==0) c = ieeeMean(copysign(0.0L, b), b);
  560   else if (b==0) c = ieeeMean(copysign(0.0L, a), a);

If a and b are double, I get the following errors:

/usr/local/include/d/phobos2/std/numeric.d(599): Error: template
std.math.ieeeMean(T) does not match any function template declaration
/usr/local/include/d/phobos2/std/numeric.d(599): Error: template
std.math.ieeeMean(T) cannot deduce template function from argument types
!()(real,double)
/usr/local/include/d/phobos2/std/numeric.d(600): Error: template
std.math.ieeeMean(T) does not match any function template declaration
/usr/local/include/d/phobos2/std/numeric.d(600): Error: template
std.math.ieeeMean(T) cannot deduce template function from argument types
!()(real,double)


This is because IFTI doesn't work with implicit conversions (bug 1641 and
probably others), and std.math.copysign() always returns a real.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list