Hacker Public Radio

Your ideas, projects, opinions - podcasted.

New episodes Monday through Friday.


HPR1292: Doomsday Remainders

Hosted by Charles in NJ on 2013-07-16 00:00:00
Download or Listen

Last Episode on Conway's Doomsday Rule ends with teaser on MOD(), a
"remainder" function defined for integer values (whole numbers):

   MOD(K, m) = remainder when K is divided by "modulus" m.
   
Examples: 
  a. MOD(207, 7) = MOD(207 - 140, 7) = MOD(67, 7) = 4
  b. MOD(1234567, 2) = 1 because the number is odd
  
MOD() function found in most spreadsheet programs, but it also shows up
as an operator in some programming languages: (a % b), or (a mod b).


Other functions referenced:
   DIV(K, m)    = quotient in integer division
      where K = m * quotient + remainder (not returned)
            0 <= remainder < m

   DIVMOD(K, m) = (quotient, remainder) when K is divided by m
      where remainder = MOD(K, m)
            quotient  = DIV(K, m)
            K = m * quotient + remainder

Full Show Notes

https://hackerpublicradio.org/eps/hpr1292.txt

Links

Comments



More Information...


Copyright Information

Unless otherwise stated, our shows are released under a Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) license.

The HPR Website Design is released to the Public Domain.