194k views
3 votes
What are the possible values of the expression a mod b, where a is an integer and b is a non-zero positive integer?

1. 0 to b-1
2. b
3. a
4. Any integer between 0 and infinity

1 Answer

0 votes

Answer:

1. 0 to b-1

Step-by-step explanation:

You want possible values of (a mod b) for integer 'a' and positive integer 'b'.

Mod

The mod function gives the positive remainder from division of 'a' by 'b'. For negative numbers, the quotient value is the floor of a/b. As such, the value of (a mod b) must lie between 0 and b-1.

__

Additional comment

In the attachment, the "remainder" function is equivalent to the "mod" function referred to in this problem.

a = q×b + r . . . . . where q = floor(a/b), and r = a mod b

6 = 1×5 + 1

-6 = -2×5 + 4

What are the possible values of the expression a mod b, where a is an integer and-example-1
User Alexey Kislitsin
by
7.7k points

No related questions found