3 ms·
> But don't use the standard mathematical symbols for operations that don't have the standard mathematical behaviour Well, we call a different operation "+", a
by JonChesterfield 2y ago
> But don't use the standard mathematical symbols for operations that don't have the standard mathematical behaviour
Well, we call a different operation "+", and there's a decent chance that either wraps a uint_max, or triggers arbitrary undefined behaviour when it goes past a limit, or that it maps to a floating point operation where x + 1 == x for large x. That's not especially like "mathematical addition", whatever you have in mind for that definition.
- lmm 2y ago> there's a decent chance that either wraps a uint_max, or triggers arbitrary undefined behaviour when it goes past a limit, or that it maps to a floating point operation where x + 1 == x for large x. I'm saying we shouldn't, and good languages won't. Using + for modulo addition is maybe acceptable, that's a reasonably standard usage in mathematics and has most of the behaviour you'd expect from addition, but using + to denote something that has undefined behaviour or suddenly shifts to floating point is certainly wrong.