Created
September 3, 2012 12:36
-
-
Save sshine/3609048 to your computer and use it in GitHub Desktop.
afrunding
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
fun afrund n = | |
let | |
val n' = Real.trunc (n * 125.0) | |
val kr = Real.fromInt (n' div 100) | |
val ore = Real.fromInt ((n' mod 100) div 25 * 25) / 100.0 | |
in kr + ore end | |
(* Mads og Christians *) | |
fun moms n = real(round(n * 4.0 * 1.25 ))/4.0; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment