[Issue 4455] New: Taking the sqrt of an integer shouldn't require an explicit cast.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jul 13 13:56:04 PDT 2010


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

           Summary: Taking the sqrt of an integer shouldn't require an
                    explicit cast.
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: dsimcha at yahoo.com


--- Comment #0 from David Simcha <dsimcha at yahoo.com> 2010-07-13 13:56:00 PDT ---
This one's been around for ages, but has just now started bothering me enough
to file a bug report:

import std.math;

void main() {
    uint num = 1;
    auto ans = sqrt(num);
}

Error:
test.d(5): Error: function std.math.sqrt called with argument types:
    ((uint))
matches both:
    std.math.sqrt(float x)
and:
    std.math.sqrt(real x)

I guess the solution is to make long and ulong overloads that forward to
std.math.sqrt(real x).

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