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





--- Comment #1 from Michiel Helvensteijn <m.helvenste...@gmail.com>  2009-07-12 
14:11:52 PDT ---
I've ran the following test:

----------------------------------
import std.stdio;

int main() {
        writefln(8/3);
        writefln(8/(-3));
        writefln((-8)/3);
        writefln((-8)/(-3));
        writefln(8%3);
        writefln(8%(-3));
        writefln((-8)%3);
        writefln((-8)%(-3));

        return 0;
}
----------------------------------

outputs the following

----------
2
-2
-2
2
2
2
-2
-2
----------

So DMD uses truncated division. The quotient rounds towards zero and the
remainder has the same sign as the dividend.

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

Reply via email to