4 ms·
= has contextual meaning in math, why not programming? It's not like we can fool ourselves into thinking that tests for equality don't also have wildly differen
by j2kun 9y ago
= has contextual meaning in math, why not programming? It's not like we can fool ourselves into thinking that tests for equality don't also have wildly different meaning depending on context. No operator has a universal meaning, nor should they.
- Guthur 9y agoCan you provide an example where equals sign is not equality I'm curious.
- mkl 9y agoDefining things, usually preceded by "let", "if", etc.: "let f(x) = 2x+1" or "let w = 2", etc. Sometimes mathematicians us ":=" to be clearer and shorter.
- webbles 9y agoWhen you aren't strictly referring to an equation.
- j2kun 9y agoMost equivalence relations eventually drop any special notation in favor of = In general, = is not rigorous. It's used as a stand-in for the word "is". Another example is when someone writes x = 1, ..., N, meant to imply x is changing, not that x is equal to a tuple. Also the index in summation notation, which really is an assignment as in programming. I could go on.
- pedasmith 9y agoHow about Σ Sigma notation for summation? It's often written with something like i=1 at the bottom and 1000 at the top to denote the summation from 1 to 1000. The Wikipedia article at https://en.wikipedia.org/wiki/Summation https://en.wikipedia.org/wiki/Summation has some examples.