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

           Summary: std.math.pow cause dead loop
           Product: D
           Version: 2.031
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: critical
          Priority: P1
         Component: Phobos
        AssignedTo: nob...@puremagic.com
        ReportedBy: rin...@gmail.com


the case is:

   pow(1.01, int.min); 

because int.min == -int.min


Maybe the while loop should be put into pow(F, uint) instead of pow(F, int)
like the following:

pure nothrow F pow(F)(F x, int n)
{
   if (n < 0)
   {
      return 1 / pow(x, cast(uint)(-n));
   }
   return pow(x, cast(uint)n);
}

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

Reply via email to