please tell the following properties:
(a-b)%m = ? (in one situation there will be an extra m)
(a/b)%m = ?
please tell the following properties:
(a-b)%m = ? (in one situation there will be an extra m)
(a/b)%m = ?
hello @prerak_semwal
(a-b)%m=(a-b+m)%m ( in evry situation this holds)
(a/b)%m= (a * mod inverse of b)%m
u should read about mod arithmetic properties
@aman212yadav
it’s there in video but there prateek bhaiya wrote
(a-b)%m = ( (a%m) - (b%m) +m ) % m
however in a problem he used:
(a-b)%m = ( (a%m) - (b%m) ) %m
On internet I found two other (different) definitions… so I’m confused about subtraction and div.!
its a property u should always add + m in case of subtraction
this is true->
verify urself from other resources