[Issue 350] New: Modulo doesn't work for negative values
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Sep 16 10:31:46 PDT 2006
http://d.puremagic.com/issues/show_bug.cgi?id=350
Summary: Modulo doesn't work for negative values
Product: D
Version: 0.166
Platform: PC
OS/Version: Windows
Status: NEW
Severity: major
Priority: P2
Component: DMD
AssignedTo: bugzilla at digitalmars.com
ReportedBy: deewiant at gmail.com
void main() {
assert (-1 % 10 == 9); // fails
}
ANSI C leaves modulo undefined for negative values, which is fine, but D
doesn't mention anything like that in the spec. If this is intentional, it
deserves a mention.
--
More information about the Digitalmars-d-bugs
mailing list