[swift-evolution] [Review] SE-0104: Protocol-oriented integers

Brent Royal-Gordon brent at architechies.com
Fri Jun 24 20:23:03 CDT 2016


> I don't have anything else to add to the concerns that have already been discussed, but I would like to reiterate on the fact that having the ,absoluteValue, property but without substituting 'abs' will induce a lot of programers to use it anyway and make mistakes.

`FloatingPoint` seems to have a similar concept to `absoluteValue` that's called "magnitude", although there's no actual `magnitude` property. Would that be a better name for this concept?

And if so, should it be on `Arithmetic`? I don't think the `FloatingPoint` spec actually specifies how absolute values should be handled (for that matter, I don't think this one does either), and currently it seems to come out of an `AbsoluteValuable` protocol that I haven't seen mentioned in either the Integer or FloatingPoint proposals.

-- 
Brent Royal-Gordon
Architechies



More information about the swift-evolution mailing list