September 17, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8672



--- Comment #8 from Jonathan M Davis <jmdavisProg@gmx.com> 2012-09-16 20:50:36 PDT ---
> Even Fortran is now and then adding important features today. Generally only
dead languages stop changing. Please keep this in mind.

If something is truly worth adding to the language, then we'll add it, but there has to be a solid reason for it. And given how we're trying to stabilize things, we're less likely to add features just because they'd be nice. Once everything's more stable, we'll probbaly be more willing to add backwards-compatible features which add real value. But I wouldn't expect %% to be added regardless, because it doesn't add enough value over simply adding a function which does the same.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
September 17, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8672



--- Comment #9 from Walter Bright <bugzilla@digitalmars.com> 2012-09-16 20:53:43 PDT ---
(In reply to comment #7)
> (In reply to comment #6)
> 
> > since there is no standard definition for it,
> 
> C99 and D use one,

C99 leaves it as "implementation defined". D defines it in the specification.

Those are fundamentally different.

> So you can say there are two "standards".

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

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
September 17, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8672



--- Comment #10 from bearophile_hugs@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: -------
September 17, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8672



--- Comment #11 from Walter Bright <bugzilla@digitalmars.com> 2012-09-17 12:02:34 PDT ---
I didn't realize that C99 did specify it. Thanks for the correction.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 27, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=8672



--- Comment #12 from bearophile_hugs@eml.cc 2013-05-27 04:53:16 PDT ---
(In reply to comment #1)

> To say one version of modulus is "bug prone" and the other is not, is itself erroneous.

I have just found another bug in my code caused by it, and it's a bug that goes away replacing it with the Python modulus operation. The built-in % operator _is_ bug prone.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
1 2
Next ›   Last »