Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

sum(x) is easiest to read. If your language doesn't provide that as standard just define it yourself. In general you should always be idiomatic, though. If every C++ developer understands the accumulate version then use that.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: