www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13963] New: BigInt modulo ulong is rejected

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

          Issue ID: 13963
           Summary: BigInt modulo ulong is rejected
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: Phobos
          Assignee: nobody puremagic.com
          Reporter: markus oberhumer.com

dmd 2.066.1

import std.bigint;

void main()
{
    BigInt x = 1;
    BigInt y = 1;
    x %= y;      // OK
    x %= 1;      // OK
    x %= 1U;     // OK
    x %= 1L;     // OK
    x %= 1UL;    // OK
    x = x % y;   // OK
    x = x % 1;   // OK
    x = x % 1U;  // OK
    x = x % 1L;  // Error: incompatible types for ((x) % (1L)): 'BigInt' and
'long'
    x = x % 1UL; // Error: incompatible types for ((x) % (1LU)): 'BigInt' and
'ulong'
}


This looks similar to issue 13391.

--
Jan 09 2015