Skip to content

Instantly share code, notes, and snippets.

@ChrisWhealy
Created April 29, 2016 17:12
Show Gist options
  • Save ChrisWhealy/834b51a996294d530dc7226cfd8d97b6 to your computer and use it in GitHub Desktop.
Save ChrisWhealy/834b51a996294d530dc7226cfd8d97b6 to your computer and use it in GitHub Desktop.
Mindshift: Part 19, sample 10
// Helper functions to reify the NUMBER function returned by DIV
var magnitude_quot = numFn => magnitude(HEAD(TAIL(numFn)));
var magnitude_rem = numFn => magnitude(TAIL(TAIL(numFn)));
var div_result = numFn =>
({ isPos : sign(numFn),
quot : magnitude_quot(numFn),
rem : magnitude_rem(numFn)
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment