[Issue 14842] New: [REG 2.068-b2] approxEqual does not work with integers

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Jul 28 01:23:54 PDT 2015


https://issues.dlang.org/show_bug.cgi?id=14842

          Issue ID: 14842
           Summary: [REG 2.068-b2] approxEqual does not work with integers
           Product: D
           Version: D2
          Hardware: x86_64
                OS: FreeBSD
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: swamplobo at gmail.com

This works with dmd2.067.1 but with 2.068-b2 I get the errors shown below.


Test code:
---
void main() {

    int a = 10;
    assert(approxEqual(10, a));

}
---


Errors:

src/phobos/std/math.d(6718): Error: std.math.fabs called with argument types
(int) matches both:
src/phobos/std/math.d(3415):     std.math.fabs(real x)
and:
/src/phobos/std/math.d(3421):     std.math.fabs(float x)
/src/phobos/std/math.d(6725): Error: std.math.fabs called with argument types
(int) matches both:
/src/phobos/std/math.d(3415):     std.math.fabs(real x)
and:
/src/phobos/std/math.d(3421):     std.math.fabs(float x)
/src/phobos/std/math.d(6726): Error: std.math.fabs called with argument types
(int) matches both:
/src/phobos/std/math.d(3415):     std.math.fabs(real x)
and:
/src/phobos/std/math.d(3421):     std.math.fabs(float x)
/src/phobos/std/math.d(6736): Error: template instance
std.math.approxEqual!(int, int, double) error instantiating
hack.d(13):        instantiated from here: approxEqual!(int, int)
Failed: ["dmd", "-v", "-o-", "hack.d", "-I."]

--


More information about the Digitalmars-d-bugs mailing list