Created
April 29, 2016 17:09
-
-
Save ChrisWhealy/efa1fb1a25d7962ef1ffe720255d9a25 to your computer and use it in GitHub Desktop.
Mindshift: Part 19, sample 7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var IS_MAGNITUDE_LTE = | |
qtyFn1 => | |
qtyFn2 => | |
IS_ZERO_MAGNITUDE(SUBTRACT_MAGNITUDES(qtyFn1)(qtyFn2)); | |
var do_div_magnitudes = | |
div_next => | |
count => | |
pair => | |
// Inner function | |
(remainder => divisor => | |
IS_MAGNITUDE_LTE(divisor)(remainder) | |
(fn => | |
(div_next(SUCC_MAGNITUDE(count)) | |
(PAIR(SUBTRACT_MAGNITUDES(remainder) | |
(divisor)) | |
(divisor))) | |
(fn)) | |
(PAIR(count)(remainder))) | |
// Supply parameters to inner function | |
(HEAD(pair)) | |
(TAIL(pair)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment