Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!gatech!mcnc!rti!xyzzy!tiktok!meissner From: meissner@tiktok.dg.com (Michael Meissner) Newsgroups: comp.lang.misc Subject: Re: Who uses BASIC these days Message-ID: <6322@xyzzy.UUCP> Date: 22 May 89 15:37:59 GMT References: <11581@well.UUCP> <960018@hpclskh.HP.COM> <832@cbnewsc.ATT.COM> Sender: usenet@xyzzy.UUCP Reply-To: meissner@tiktok.UUCP (Michael Meissner) Organization: Data General (Languages @ Research Triangle Park, NC.) Lines: 26 In article <832@cbnewsc.ATT.COM> nevin1@ihlpb.ATT.COM (nevin.j.liber) writes: | In article <960018@hpclskh.HP.COM> skh@hpclskh.HP.COM (The Polar Bear) writes: | | >Integer arithmetic is often of insufficient range for financial applications. | >When you start doing programs for multi-national companies and governments, | >you start needing exponents. | | But how do you get the needed PRECISION from floating point? Unless | these mulit-national comanies and governments don't mind losing a few | dollars when the numbers get too big. :-) Please elaborate. You use double precision, which most languages support directly. For example, with IEEE floating point, a double looks like: sign 1 bit exponent 11 bits mantissa 52 bits + 1 hidden bit for normalization As long the value is less than ~ 9e15 (ie, 12 full digits for dollars + 2 for cents), everything is fine (though if you use this scheme, you should take some pains to make sure division is rounded to an integral value after each division). -- Michael Meissner, Data General. Uucp: ...!mcnc!rti!xyzzy!meissner If compiles were much Internet: meissner@dg-rtp.DG.COM faster, when would we Old Internet: meissner%dg-rtp.DG.COM@relay.cs.net have time for netnews?