I have a math problem that is part of my programming problem
I have an operator like
a = b%30;
How can I calculate bin terms a?
b
a
I thought, but could not understand.
A-priory
b == 30*n + a
for some whole n.
n
Note that there are several values bthat can give you the same a:
>>> b = 31 >>> b % 30 1 >>> b = 61 >>> b % 30 1
Firstly, itβs obvious that for a given awhole there are several solutions for b.
% - , , a . , - , ?
%
| a | >= 30,
a = 0, 30.
0 < a < 30, b , b = 30 * k + a k.
b = 30 * k + a
k
-30 < a < 0, - b , b = - (30 * k - a) k.
b = - (30 * k - a)