Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let rec srednia_geometryczna (ilosc:int) (suma:double) =
- let znak = System.Console.Readline()
- let wartosc = System.Convert.ToDouble(znak)
- if wartosc = 0.0 then (
- if ilosc <> 0 then (suma, System.Math.Pow(suma, (1.0 / double ilosc)))
- else (0.0, System.Double.NaN)
- )
- else srednia (ilosc + 1) (suma + wartosc)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement