[swift-evolution] [swift-evolution-announce] [Review] SE-0067: Enhanced Floating Point Protocols

Dave Abrahams dabrahams at apple.com
Fri Apr 22 11:42:01 CDT 2016

on Fri Apr 22 2016, Stephen Canon <swift-evolution at swift.org> wrote:

>     I’d be okay with Greg’s idea of changing the type to an enum. I’d also be
>     okay with renaming this to a predicate, whatever the name ends up being.
>     (“isSignBitSet”, “isSignNegative”, etc.)
> Making it a predicate is weird, because then the three properties making up the
> number become `isSignBitSet`, `exponent`, and `significand`; one of these things
> is not like the other ones. If `signBit: Bool` were ruled out, I would rather go
> with Greg’s enum proposal.

This argument makes no sense to me.  A floating point number is made up
of three parts, and one part *is* not like the other ones.  Furthermore,
using an enum doesn't change that one (ahem) bit.


More information about the swift-evolution mailing list