On Sat, 2015-10-31 at 15:41 +0000, tcak via Digitalmars-d-learn wrote: > On Saturday, 31 October 2015 at 14:37:23 UTC, rumbu wrote: > > On Friday, 30 October 2015 at 10:35:03 UTC, Laeeth Isharc wrote: > > > I'm writing a talk for codemesh on the use of D in finance. > > > > > > Any other thoughts? > > > > For finance stuff - missing a floating point decimal data type. > > Things like 1.1 + 2.2 = 3.3000000000000003 > > I always thought that this type of arithmetic operations can be > solved with BigInt, but never tried it. Since the issue is > related to IEEE standard, a simulated (not supported by hardware > directly) data type might be required.
In that std.bigint.BigInt provides the accuracy, yes it does suffice. But it is slow. As far as I am aware only IBM Big Iron (aka mainframes, aka z-Series) has hardware decimal floating point these days. (Even though 1970s and 1980s microprocessors had the feature.) -- Russel. ============================================================================= Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.win...@ekiga.net 41 Buckmaster Road m: +44 7770 465 077 xmpp: rus...@winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
signature.asc
Description: This is a digitally signed message part