[swift-evolution] BigDecimal functionalities or modulus support for NSDecimalNumber

Andrea Leganza neogene at gmail.com
Sat Jun 25 14:06:58 CDT 2016


Hello all,

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: https://en.wikipedia.org/wiki/International_Bank_Account_Number <https://en.wikipedia.org/wiki/International_Bank_Account_Number>)

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 (https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSDecimalNumber_Class/ <https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSDecimalNumber_Class/>) which doesn’t support modulus

I had to use and external library like this one: https://github.com/mkrd/Swift-Big-Integer <https://github.com/mkrd/Swift-Big-Integer> 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.

if something already exists sorry for the trouble.

best regards. 
eng. Andrea Leganza
—————————————————
Docente di Fondamenti di programmazione c/o Istituto Quasar - Roma
Docente di Progettazione di Applicazioni per Dispositivi Mobili c/o Istituto Quasar - Roma
Docente di Unity3D c/o Vigamus Academy - Roma
Docente di Programmazione Web c/o ENAIP - Roma
Redattore magazine Io Programmo - ed. Master
Adobe Flex & Air certified
Sun Java 1.6 Certified
EUCIP Core Certified

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160625/bf38bf9f/attachment.html>


More information about the swift-evolution mailing list