How does "magic number" algorithm work

Would anyone happen to have a pointer to a proof of how the "magic number" algorithm for finding a subnet number's "interesting" octet decimal value works? I.e., WHY does it work, mathematically speaking?

Algorithm is: subtract the mask's "interesting" (non-255) decimal number from 256, which yields the "magic number". Then find the largest multiple of the "magic number" that is less than the "interesting" decimal value in question--this is the "interesting" decimal number for the subnet address.

Reply to
Ira Gladnick
Loading thread data ...

Cabling-Design.com Forums website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.