<div dir="ltr">On Sun, Apr 16, 2017 at 12:30 PM, David Sweeris via swift-evolution <span dir="ltr"><<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
> On Apr 16, 2017, at 09:56, Nevin Brackett-Rozinsky via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br>
><br>
> 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”,<br>
<br>
</span>Division by 0, incrementing past the largest representable value, probably a couple others that I'm not thinking of.<br></blockquote><div><br></div><div>Those are reasons for integers to overflow.</div><div><br></div><div>Floating point values become NaN when you try to compute 0/0, when you try to subtract infinity from itself, and when you try to multiply 0 and infinity. There are also various trigonometric and hyperbolic functions that are expected to emit NaN for various reasons, and for complex numbers these reasons multiply (haha).</div><div><br></div><div>The point is that, when you manipulate two real numbers, sometimes there is no numeric result. You cannot simply wish this away with a new numeric type because it is not an artifact of _modeling_ real numbers but rather intrinsic to mathematics itself.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
> and what sort of name is “Double” anyway except as a hold-over from legacy standards?<br>
<br>
</span>FWIW, I suggested something like that ("Float"->"Float32", "Double"->"Float64", and typealias the largest CPU-native type to just "Float") a while back and the consensus was that we wanted to preserve the current notation.<br>
<br>
- Dave Sweeris<br>
<div class="HOEnZb"><div class="h5">______________________________<wbr>_________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-<wbr>evolution</a><br>
</div></div></blockquote></div><br></div></div>