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

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


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





--- Comment #3 from Lars T. Kyllingstad <bugzilla at kyllingen.net>  2009-08-10 04:50:09 PDT ---
There's an even simpler fix -- i.e. less typing. :)

Since both a, b and c are of type T, this also works:

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

I've added this fix to my local Phobos. I just tried this for fun, and expected
to get an error from trying to implicitly cast real to double. But for some
reason it worked.

-- 
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