[Issue 8672] %% operator

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Sep 16 16:34:50 PDT 2012


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



--- Comment #4 from Walter Bright <bugzilla at digitalmars.com> 2012-09-16 16:35:40 PDT ---
The point is, the programmer has to take "extra care" regardless.

All definitions of modulus are a "land mine", as they are all arbitrary. There
is no such thing as a mathematically correct one. Nor is there any such thing
as a "natural" result of modulus. It may be natural for your particular code
example, and for your experience, but that doesn't mean it is generally true
for uses of modulus.

The diversity of definitions for it strongly suggests that there is no
"natural" defintion.

D improves on the C/C++ situation by making it defined behavior, rather than
undefined.

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


More information about the Digitalmars-d-bugs mailing list