We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello,
According to the book the solution could be :
films.foldLeft(0)((a, b) => a.imdbRating + b.imdbRating) / films.length
but a is a sort of accumelator so it do not have the property imdbRating. The solution that works for me is :
allFilms.foldLeft(0:Double)((a,b) => a + b.imdbRating) / allFilms.length
I have to cast the 0 to Double otherwise the compiler thinks that 0 is a Int and imdbRating is a double and that will not work.
Roelof
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello,
According to the book the solution could be :
but a is a sort of accumelator so it do not have the property imdbRating.
The solution that works for me is :
I have to cast the 0 to Double otherwise the compiler thinks that 0 is a Int and imdbRating is a double and that will not work.
Roelof
The text was updated successfully, but these errors were encountered: