Thread overview
[Issue 551] New: Modulo operator works with imaginary and complex operands
Nov 18, 2006
d-bugmail
Nov 25, 2006
Thomas Kuehne
Oct 04, 2007
d-bugmail
Oct 20, 2007
d-bugmail
November 18, 2006
http://d.puremagic.com/issues/show_bug.cgi?id=551

           Summary: Modulo operator works with imaginary and complex
                    operands
           Product: D
           Version: 0.174
          Platform: PC
               URL: http://www.digitalmars.com/d/expression.html
        OS/Version: Windows
            Status: NEW
          Keywords: spec
          Severity: normal
          Priority: P4
         Component: DMD
        AssignedTo: bugzilla@digitalmars.com
        ReportedBy: deewiant@gmail.com
OtherBugsDependingO 511
             nThis:


The spec states that "[t]he modulus operator only works with reals, it is illegal to use it with imaginary or complex operands." yet DMD accepts all of the following:

void main() {
        creal c = 1 + 1i;
        c %= 2;

        ireal i = 3i % 2;

        real r = 3 % 3i;
}


-- 

November 25, 2006
d-bugmail@puremagic.com schrieb am 2006-11-18:
> http://d.puremagic.com/issues/show_bug.cgi?id=551

> The spec states that "[t]he modulus operator only works with reals, it is illegal to use it with imaginary or complex operands." yet DMD accepts all of the following:
>
> void main() {
>         creal c = 1 + 1i;
>         c %= 2;
>
>         ireal i = 3i % 2;
>
>         real r = 3 % 3i;
> }

Added to DStress as http://dstress.kuehne.cn/nocompile/o/opMod_03_A.d http://dstress.kuehne.cn/nocompile/o/opMod_03_B.d http://dstress.kuehne.cn/nocompile/o/opMod_03_C.d http://dstress.kuehne.cn/nocompile/o/opMod_03_D.d http://dstress.kuehne.cn/nocompile/o/opMod_03_E.d http://dstress.kuehne.cn/nocompile/o/opMod_03_F.d http://dstress.kuehne.cn/nocompile/o/opMod_03_G.d http://dstress.kuehne.cn/nocompile/o/opMod_03_H.d http://dstress.kuehne.cn/nocompile/o/opMod_03_I.d http://dstress.kuehne.cn/nocompile/o/opMod_03_J.d http://dstress.kuehne.cn/nocompile/o/opMod_03_K.d http://dstress.kuehne.cn/nocompile/o/opMod_03_L.d http://dstress.kuehne.cn/nocompile/o/opMod_04_A.d http://dstress.kuehne.cn/nocompile/o/opMod_04_B.d http://dstress.kuehne.cn/nocompile/o/opMod_04_C.d http://dstress.kuehne.cn/nocompile/o/opMod_04_D.d http://dstress.kuehne.cn/nocompile/o/opMod_04_E.d http://dstress.kuehne.cn/nocompile/o/opMod_04_F.d http://dstress.kuehne.cn/nocompile/o/opMod_04_G.d http://dstress.kuehne.cn/nocompile/o/opMod_04_H.d http://dstress.kuehne.cn/nocompile/o/opMod_04_I.d http://dstress.kuehne.cn/nocompile/o/opMod_04_J.d http://dstress.kuehne.cn/nocompile/o/opMod_04_K.d http://dstress.kuehne.cn/nocompile/o/opMod_04_L.d http://dstress.kuehne.cn/nocompile/o/opMod_05_A.d http://dstress.kuehne.cn/nocompile/o/opMod_05_B.d http://dstress.kuehne.cn/nocompile/o/opMod_05_C.d http://dstress.kuehne.cn/nocompile/o/opMod_05_D.d http://dstress.kuehne.cn/nocompile/o/opMod_05_E.d http://dstress.kuehne.cn/nocompile/o/opMod_05_F.d http://dstress.kuehne.cn/nocompile/o/opMod_05_G.d http://dstress.kuehne.cn/nocompile/o/opMod_05_H.d http://dstress.kuehne.cn/nocompile/o/opMod_05_I.d http://dstress.kuehne.cn/nocompile/o/opMod_05_J.d http://dstress.kuehne.cn/nocompile/o/opMod_05_K.d http://dstress.kuehne.cn/nocompile/o/opMod_05_L.d

Thomas


October 04, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=551





------- Comment #2 from bugzilla@digitalmars.com  2007-10-04 01:02 -------
It's supported by the compiler, I'll change the docs.


-- 

October 20, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=551


braddr@puremagic.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Comment #3 from braddr@puremagic.com  2007-10-20 04:01 -------
Docs updated in the 1.022/2.005 release to show that it's legal code.


--