A blog about various cs ideas
def sum(f: Int => Int, a: Int, b: Int) = { def loop(a: Int, acc: Int): Int = if (a>b) acc else loop(a+1, f(a) + acc) loop(a, 0)}
No comments:
Post a Comment