In the book by Rod Stevenson "Algorithms", it says: enter image description here

A is the first value, B is the second, R is the remainder
It is not clear why at the end B 1 -R 1 = B 1 mod R 1

For example, for values ​​128 and 12, this is true:
A 1 = 128, B 1 = 12, R 1 = 8
B 1 -R1 = 4, B 1 mod R 1 = 4.
4 = 4

But, for example, for the numbers 2602 and 256 this is unfair:
A 1 = 2602, B 1 = 256, R 1 = 42
B 1 -R1 = 214, B 1 mod R 1 = 4
214! = 4

Or did I misunderstand something?

  • Well, at least there are words. More can be ... - pavel
  • @pavel I understood this, but why B1-R1 = B1 mod R1? - khirnick
  • It seems to me it is written there ... It is assumed that the decrease is less than 2 times, it means only 1 time r1 is subtracted. From the opposite. In general, why do you understand it? Believe the word) - pavel

0