[Issue 8672] %% operator

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Sep 17 09:58:42 PDT 2012


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



--- Comment #10 from bearophile_hugs at eml.cc 2012-09-17 09:59:26 PDT ---
(In reply to comment #9)

> C99 leaves it as "implementation defined". D defines it in the specification.
> 
> Those are fundamentally different.

In the table of the Wikipedia page you have linked there is written:

C (ISO 1990)     %     Implementation defined

C (ISO 1999)     %     Dividend[1]

Where the reference [1] is:
http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf, section 6.5.5

6.5.5.5 paragraph says:

>The result of the / operator is the quotient from the division of the first operand by the second; the result of the % operator is the remainder.In both operations, if the value of the second operand is zero, the behavior is undefined.<


> As I cited, there are FOUR different standards on this, not including the C99
> "implementation defined" one.

But by far the most common ones are two of them (counting languages: 45+
Dividend, 31+ Divisor, and 8 something different).

-- 
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