modulo Strangeness?

safety0ff via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Jun 11 15:41:05 PDT 2014


On Wednesday, 11 June 2014 at 22:32:45 UTC, Taylor Hillegeist 
wrote:
> I have a simpleish bit of code here that always seems to give 
> me an error, and i can't figure out quite why.
modulo takes the sign of the dividend:
http://en.wikipedia.org/wiki/Modulo_operation#Common_pitfalls

It works with length because you introduce a signed -> unsigned 
conversion.


More information about the Digitalmars-d-learn mailing list