<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Depends on what you want to achieve.</div><div class=""><br class=""></div><div class="">If it's really used for math, then yes, it's great to have such a library available.</div><div class="">Not many "real" use cases, though, imo, to warrant putting it into the core library atm.</div><div class=""><br class=""></div><div class="">For finance, I guess that's what's `NSDecimalNumber` is for. </div><div class="">This class is not that nice to use from Swift, though.</div><div class=""><br class=""></div><div class="">For crypto, you don't want to use a common BigInt library. </div><div class="">- The library doesn't provide any security guarantees. e.g. when buffers are cleared etc.</div><div class="">- Crypto typically involves fixed sizes (e.g. 256-bit). With common BigInts, you lose performance.</div><div class="">- Crypto is not possible to be implemented securely in pure Swift 2.</div><div class=""> The language lacks annotations to prevent compiler optimisations on a fine-grained level.</div><div class=""> i.e. timing invariance of comparisons etc is not guaranteed / no control about caching behaviour.</div><div class=""> Need to do that in Assembly to be safe against side channel attacks.</div><div class=""> Even with Assembly, you may lose to CPU microcode optimisations. Out of scope, though.</div><div class=""><br class=""></div><div class=""><br class=""></div><br class=""><div><blockquote type="cite" class=""><div class="">On 12 Dec 2015, at 12:37, Otto van Verseveld via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div dir="ltr" class="">About I year ago I started, while Swift was still in beta development, a github project containing a wrapper for the GNU Multiple Precision Arithmetic library (see: <a href="https://github.com/githotto/osxgmp" class="">https://github.com/githotto/osxgmp</a>).<div class=""><br class=""><div class="">I haven't done much on it lately, also because some questions were not answered in the GMP-community yet. I want to make it also suitable for iOS development, since currently it compiles / runs only on OSX.</div><div class=""><br class=""></div><div class="">Do you think there is a need for this 'swift-extension' API/library and it is worthwhile developing further such that the Swift language will have a BigDecimal/BigInt library as being present in Java/C#?</div><div class=""><br class=""></div><div class="">Any thoughts or even help or suggestions on how to get it compiled for iOS are very welcome!</div><div class="">Thanks in advance, kind regards,</div><div class="">Otto van Verseveld</div><div class=""><br class=""></div></div></div>
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=tTTJ5sn5y0uc3ODSZa-2BndLNwXCDS7T2cq5OlDDhG0RveUXPO-2BWYy-2BINNHazWYWM1kqj45q-2BjYMh-2FAO5NveOKidOh3D-2BEu-2FAdZ2aBCYjnoJzvSgofqo8bB-2FT2eKV8n4nplpxwxu91JYOVYE7-2FbTL3RuIjrUncEA2aTyw14sPMvc-2BkkajFsVmsV2-2Bb6N96oQdU0sPy8583dFpa9vC-2BxO8tnm0zzClTgwHcm3yR23jCfIQ-3D" alt="" width="1" height="1" border="0" style="height:1px !important;width:1px !important;border-width:0 !important;margin-top:0 !important;margin-bottom:0 !important;margin-right:0 !important;margin-left:0 !important;padding-top:0 !important;padding-bottom:0 !important;padding-right:0 !important;padding-left:0 !important;" class="">
_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></body></html>