{"id":3892,"date":"2014-03-25T18:39:04","date_gmt":"2014-03-25T18:39:04","guid":{"rendered":"http:\/\/www.oracletutoring.ca\/blog\/?p=3892"},"modified":"2018-02-20T16:44:14","modified_gmt":"2018-02-20T16:44:14","slug":"math-div-and-mod","status":"publish","type":"post","link":"https:\/\/www.oracletutoring.ca\/blog\/math-div-and-mod\/","title":{"rendered":"Math:  div and mod"},"content":{"rendered":"<h1>Tutoring math, you know that div and mod are also fundamental to computer science.\u00a0 The tutor presents them with an example.<\/h1>\n<p>Consider the age-old long division situation:<br \/>\n<img decoding=\"async\" src=\"\/..\/longdv.png\"\/  style=\"display:block;margin-left:auto;margin-right:auto\"\/><\/p>\n<p>In this case, the question posed is &#8220;30 divided by 7&#8221;.  The answer is &#8220;4, remainder 2.&#8221;  But in terms of div and mod, what does it mean?<\/p>\n<p>4 is the answer to 30 div 7.  The div operation gives the integer quotient of a division:  it gives the number of times the divisor can go in.  The mod operator, on the other hand, gives the remainder of a division:  30 mod 7 is 2, just as shown above.<\/p>\n<p>A really neat example of div and mod in action is the following:<\/p>\n<p><strong>Example:  Convert 103 inches to feet and inches<\/strong><\/p>\n<p>Solution: Set it up long division style, like so:<br \/>\n<img decoding=\"async\" src=\"\/..\/longdv1.png\" style=\"display:block;margin-left:auto;margin-right:auto\"\/><\/p>\n<p>The answer is that 103 inches is 8 feet, 7 inches.  103 div 12=8 gives the feet, while 103 mod 12=7 gives the inches.  Once again:  div gives the integer quotient, whereas mod gives the remainder.<\/p>\n<p>For more implications of div and mod, come visit again:)<\/p>\n<p>Jack of <a href=\"https:\/\/www.oracletutoring.ca\">Oracle Tutoring by Jack and Diane,<\/a> Campbell River, BC.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Tutoring math, you know that div and mod are also fundamental to computer science.\u00a0 The tutor presents them with an example. Consider the age-old long division situation: In this case, the question posed is &#8220;30 divided by 7&#8221;. The answer &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"more-link\" href=\"https:\/\/www.oracletutoring.ca\/blog\/math-div-and-mod\/\"> <span class=\"screen-reader-text\">Math:  div and mod<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[105,3],"tags":[],"class_list":["post-3892","post","type-post","status-publish","format-standard","hentry","category-computer-science","category-math"],"_links":{"self":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/3892","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/comments?post=3892"}],"version-history":[{"count":13,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/3892\/revisions"}],"predecessor-version":[{"id":30170,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/3892\/revisions\/30170"}],"wp:attachment":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/media?parent=3892"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/categories?post=3892"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/tags?post=3892"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}