3 ms·
I think your original function was pure in the mathematical sense, but since you were operating on a data structure that is specifically 2 or 3 elements long, t
by daemin 15y ago
I think your original function was pure in the mathematical sense, but since you were operating on a data structure that is specifically 2 or 3 elements long, then you don't need to be that generic.
Just think of a vector of 3 elements as being one entity, and therefore it still obeys the 0, 1, Inf rule mentioned elsewhere in the comments.