Created
November 26, 2012 22:26
-
-
Save adilakhter/4151069 to your computer and use it in GitHub Desktop.
list.average
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
let avg list = | |
let rec avgAux sum length list = | |
match list with | |
| [] -> sum/length | |
| x::xs -> avgAux (x+sum) (length + 1) xs | |
avgAux 0 0 list |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment