@boomzilla said:Hmmm....negative ordinals. Taking Asimov to the next logical step, I suppose, but unorthodox.In light of my last reply, and reviewing the thread, it appears my earlier thoughts in reply boomzilla went missing (or I simply didn't post it.. which is more likely.)
The library function concerned is used in a very small fraction of the total codebase that uses the whole library, and in the instances where it is used (including debug statements) are neither
time sensitive,
bottleneck/inner-loop suspects where the difference between ?: and abs() could ever be an issue or
where the parameter passed in would be (sensibly) negative
In short, it's used for user presentation for one small aspect of the system where you can't have a negative number of 'foo'.
Hence my copy/paste suspicion mentioned in my last post.
(And the aforementioned absence of my un-posted suggestion that "simply requiring the parameter to be unsigned instead of signed, and requiring callers that may require its use on negative values to figure out the signage before/when calling it would be better.")