[swift-evolution] Support for newtype feature/typesafe calculations
Stephen Canon
scanon at apple.com
Thu Jan 7 13:48:01 CST 2016
> On Jan 7, 2016, at 12:40 PM, Mark Glossop via swift-evolution <swift-evolution at swift.org> wrote:
>
> Sidebar on decimal numerics since they're relevant to support for currency units - would be nice to know if the "new" IEEE 754 (2008) Decimal floating-point types are in the Swift roadmap?
> My suspicion is that any support for them will only come from upstream in LLVM as a first-class type [quad precision/binary128 is supported as the fp128 type; but no decimal floating-point types at present] - so looks like any fixed-point decimal support in the interim would need to be provided by hacking int types, but if anyone wants to chime in... :-)
Decimal FP is somewhere in the hazy far-future hypothetical roadmap. It’s actually far more useful than (software) Binary128; implemented in software the performance delta between the two is fairly narrow on modern CPU architectures (except possibly for division), and having a decimal FP type available would be quite nice.
There’s a lot of lower-hanging fruit to chip away on first, however.
– Steve
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160107/1396de6d/attachment.html>
More information about the swift-evolution
mailing list