Skip to content

Instantly share code, notes, and snippets.

@danlamanna
Created September 5, 2014 05:09
Show Gist options
  • Select an option

  • Save danlamanna/955e00d2e3edac0b7a45 to your computer and use it in GitHub Desktop.

Select an option

Save danlamanna/955e00d2e3edac0b7a45 to your computer and use it in GitHub Desktop.
fun decbin(0, l) = l
| decbin(n, l) =
let
val quotient = floor(real(n) / 2.0);
val remainder = n mod 2;
in
decbin(quotient, remainder::l)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment