<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="">It shouldn't be hard to add your own modulo implementation:<div class=""><br class=""></div><div class="">mod = code - (floor(code / 97) * 97)</div><div class=""><br class=""></div><div class="">given all operations are on NSDecimalNumber (or Decimal in Swift 3.0)...</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jun 25, 2016, at 9:06 PM, Andrea Leganza via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; 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="">Hello all,<div class=""><br class=""></div><div class="">i was working with huge int numbers (28 digits) due to the developing of an algorithm to check the validity of IBAN bank codes (source:&nbsp;<font face="Menlo" class=""><span style="font-size: 11px;" class=""><a href="https://en.wikipedia.org/wiki/International_Bank_Account_Number" class="">https://en.wikipedia.org/wiki/International_Bank_Account_Number</a></span></font>)</div><div class=""><br class=""></div><div class="">The algorithm requests to check the modulus of the 28 digits number with value 97, the only type which was useful due to the size which can contain was NSDecimalNumber (<a href="https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSDecimalNumber_Class/" class="">https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSDecimalNumber_Class/</a>) which doesn’t support modulus</div><div class=""><div class="">
<div style="orphans: 2; widows: 2; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""></div><div style="orphans: 2; widows: 2; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I had to use and external library like this one:&nbsp;<a href="https://github.com/mkrd/Swift-Big-Integer" class="">https://github.com/mkrd/Swift-Big-Integer</a>&nbsp;which supports int and double, maybe adding the modulus operation to NSDecimalNumber will be useful for some users or creating a framework to manage huge int or double.</div><div style="orphans: 2; widows: 2; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""></div><div style="orphans: 2; widows: 2; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">if something already exists sorry for the trouble.</div><div style="orphans: 2; widows: 2; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""></div><div style="orphans: 2; widows: 2; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">best regards.&nbsp;</div><div style="orphans: 2; widows: 2; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">eng. Andrea Leganza<br class="">—————————————————</div><div style="orphans: 2; widows: 2; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><span style="text-align: -webkit-auto;" class="">Docente di Fondamenti di programmazione c/o Istituto&nbsp;Quasar - Roma</span></div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Docente di&nbsp;Progettazione di Applicazioni per Dispositivi Mobili&nbsp;c/o Istituto&nbsp;Quasar - Roma</div><div class="">Docente di Unity3D c/o Vigamus Academy - Roma</div><div class="">Docente di Programmazione Web c/o ENAIP - Roma</div><div class="">Redattore magazine Io Programmo - ed. Master</div><div class="">Adobe Flex &amp; Air certified</div><div class="">Sun Java 1.6 Certified<br class="">EUCIP Core Certified</div></div></div>
</div>
<br class=""></div></div>_______________________________________________<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=""></div></body></html>