<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=""><div class="">There is still no fixed decimal numerical type available in Swift!</div><div class=""><br class=""></div><div class="">It should be implemented *as soon as possible* </div><div class="">because the fixed decimal type is really needed </div><div class="">for applications working with financial and statistical data!</div><div class=""><br class=""></div><div class="">E.g. </div><div class="">var depositPromille: Decimal(10,3) = -1234.56</div><div class="">typealias Money = Decimal(20,2) </div><div class=""><br class=""></div><div class="">Important: Implementation should be on a low level</div><div class="">and must be very, very efficient!</div><div class="">This is because usually in financial applications </div><div class="">very large amounts of data (e.g. bank accounts) are processed. </div><div class=""><br class=""></div><div class="">I’d suggest that Swift could deploy already existing</div><div class="">Fixed Decimal library functions available. </div><div class="">In fact, many do exist, for example here:</div><div class=""><a href="http://gcc.gnu.org/onlinedocs/gcc-4.6.0/libstdc++/api/a01152.html" class="">http://gcc.gnu.org/onlinedocs/gcc-4.6.0/libstdc++/api/a01152.html</a> </div><div class=""><br class=""></div><div class="">Of course, the fixed decimal type is also available in most relational databases,</div><div class="">currently there is no 1:1 way to get this type of data DB <—> Swift,</div><div class="">and to process it easily in Swift. One now has to convert it e.g.</div><div class="">to large integers, thereby also somehow remembering the decimal fraction.</div><div class="">Yes, one could write a class/struct for it, but one also has</div><div class="">to implement all the arithmetic involved, with also needs </div><div class="">rounding, truncation, etc. It would also be too slow.</div><div class=""><br class=""></div><div class="">For those still considering using floating point types</div><div class="">for this purpose e.g. Double: Forget it, because </div><div class="">floating point types don’t have the required exact precision.</div><div class="">E.g. € 234,565,098.01 // the one cent at the end is important!</div><div class=""><br class=""></div><div class=""> </div><div class="">For some idea on how this could be implemented in the Swift language</div><div class="">please read a PL/1 manual, like this one: </div><div class=""><br class=""></div><div class=""><a href="http://www.ibm.com/support/knowledgecenter/#!/SSY2V3_4.3.0/com.ibm.entpli.doc_4.3/lr/preface_plugin.htm" class="">http://www.ibm.com/support/knowledgecenter/#!/SSY2V3_4.3.0/com.ibm.entpli.doc_4.3/lr/preface_plugin.htm</a></div><div class=""><br class=""></div><div class="">especially under sub-topic “Data elements” </div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Kind Regards</div><div class="">TedvG</div></body></html>