<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Agreed. I think the first step if we are interested in unums is to make a 3rd party library. (There are apparently chips already in the pipeline, but it won’t affect iOS or Macs, which are the main targets for Swift.)<div class=""><br class=""></div><div class="">That said, whether the implementation is based on unums or not, I would really like to see Swift 5/6 move towards having a core floating point type which abstracts away most of the legacy issues. It is crazy to me that we are continuing to bake-in issues based on the limitations of 1980’s tech. </div><div class=""><br class=""></div><div class="">Ideally, there would be a “Float” or “Decimal" type that would Just Work™ for typical / everyday calculations involving decimals (as an analog to Int which just works for integer calculations, but doesn’t guarantee a specific precision), and then various specific formats for people who need specific guarantees (like IEEE conformance or a specific precision). This would replace things like CGFloat and most uses of Float/Double. It should be abstract enough that we could change the internal implementation as needed (or even to have various implementations ala CGFloat). It should not even mess with things like NaN and infinity, leaving those concepts to the specific formats (and using optionals, trapping, or swift error handling when operations can fail).<br class=""><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Jon</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Apr 27, 2017, at 5:46 PM, Stephen Canon <<a href="mailto:scanon@apple.com" class="">scanon@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">On Apr 27, 2017, at 7:35 PM, Jonathan Hull via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:<div class=""><br class=""><div class=""><blockquote type="cite" class=""><div class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">I doubt we would get rid of Double/Float, but I would love to see it used as a core type in Swift 5.</span></div></blockquote></div><br class=""><div class="">Not to be discouraging, but Swift 5 is wildly ambitious for the inclusion of unum in the stdlib core. Unums will be multiple orders of magnitude slower (and more importantly, less energy efficient) than Float or Double for the foreseeable future, due to the complete lack of hardware support. Hardware can be designed, but no one’s doing it yet, and the timeline from “functional unit is proposed” to “working hardware appears” is around 3-5 years *minimum*. For a large feature without any real precedent, tack on a couple more years. Then you have another 3-5 years before the feature is widely available on a majority of machines in the field.</div><div class=""><br class=""></div><div class="">For that matter, the actual definition of what “unums” are keeps changing. It wouldn’t make sense to put them in the stdlib until the definitions stabilize. Meanwhile we don’t even have bignum integers or complex numbers in the stdlib yet. There’s lots of lower-hanging fruit with a much wider audience to sort out while we wait to see what happens with unum.</div><div class=""><br class=""></div><div class="">If you want to explore unums, I encourage you to do so. I think it would be great for someone to throw a Swift unum library up on GitHub for people to try out. There’s just a whole lot of stuff that should happen before it becomes part of the stdlib.</div></div><div class=""><br class=""></div><div class="">– Steve</div></div></div></blockquote></div><br class=""></div></div></body></html>