3 ms·
An actual example of this concept coming up: I had a question about something with a distance formula, and the choice to either explicitly check the length of
by SomeStupidPoint 9y ago
An actual example of this concept coming up:
I had a question about something with a distance formula, and the choice to either explicitly check the length of the points coming in, which were a list of coordinates, (either to ensure a particular dimension or a matching dimension) or another option to iterate over the components, which has a sane "dimension extension" behavior.
It wasn't until I looked up the available floating point math functions that I knew their limits and could decide on how to implement the dimensionality handling.
So in that case, my thought process went:
Figure out the math -> Figure out how to apply it, eg map to a list of pairs of points (which also constrains math implementation) -> implement guarding on input to match contract