[swift-evolution] [pitch] Comparison Reform

Nevin Brackett-Rozinsky nevin.brackettrozinsky at gmail.com
Sun Apr 16 11:56:31 CDT 2017


Another option is to make a new type, not sure what to call it but I’ll use
“Num” for now, that is essentially the same as Double except it does not
represent NaN. After all, why should a numeric type ever be “not a number”,
and what sort of name is “Double” anyway except as a hold-over from legacy
standards?

Then people who really need IEEE semantics can keep using Double with all
its quirks. But everyone else who just wants a floating-point value can use
Num, and if they need to represent NaN they can use an Optional<Num>.
Operations which would produce NaN on Double will simply trap when done on
Num.

Nevin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170416/0f4e330d/attachment.html>


More information about the swift-evolution mailing list