Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
mlevental
on May 28, 2019
|
parent
|
context
|
favorite
| on:
Translating math into code with examples in Java, ...
any sum with an index of summation requires mutability
chobytes
on May 28, 2019
|
next
[–]
"requires" is a strong word. the only explicit definition ive seen given for n-ary summations and products products was recursive.
brianberns
on May 29, 2019
|
prev
[–]
I don't think so. For example, sum of first 5 integers:
sum i = 1 to 5 of i -> 1 + 2 + 3 + 4 + 5 = 15
Nothing mutable there. In functional programming this is done with a `fold`, which doesn't use mutation.
pron
on May 29, 2019
|
parent
[–]
We're talking about
notation
. Anything could be described in any Turing complete language. It's uncommon to have something similar to mutation in ordinary mathematical notation, but summation is one example where it's used.
Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: