wanda 0 Newbie Poster

When using the modulus, if a<b, then a%b = a. But why, if a is negative, does -a%b = -a? According to the division algorithm, the remainder r must be >= 0 and <|b|.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.