Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!vrdxhq!BMS-AT!stuart From: stuart@BMS-AT.UUCP (Stuart D. Gathman) Newsgroups: net.arch Subject: Re: Floating point performance Message-ID: <253@BMS-AT.UUCP> Date: Tue, 21-Oct-86 12:02:31 EDT Article-I.D.: BMS-AT.253 Posted: Tue Oct 21 12:02:31 1986 Date-Received: Wed, 22-Oct-86 22:59:30 EDT References: <340@euroies.UUCP> <1989@videovax.UUCP> <722@mips.UUCP> <6028@ut-sally.UUCP> Organization: Business Management Systems, Inc., Fairfax, VA Lines: 32 Summary: There's a reason for floating point. In article <6028@ut-sally.UUCP>, nather@ut-sally.UUCP (Ed Nather) writes: > long as I sometimes needed. Then I learned about floating point . . . > . . . . It sounded great until I learned that you give up > something when you do things that way --simple operations become much > more complex (and slower) using standard hardware. . . . For problems appropriate to floating point, the input is already imprecise. Planck's constant is not known to more than a dozen digits at most. Good floating point software keeps track of the remaining precision as computations proceed. Even if the results were computed precisely using rational arithmetic, the results would be more imprecise than the input. Rounding in floating point hardware contributes only a minor portion of the imprecision of the result in properly designed software. For problems unsuited to floating point, e.g. accounting, yes the floating point hardware gets in the way. For accounting one should use large integers: 48 bits is plenty in practice and no special hardware is needed. The 'BCD' baloney often advocated is just that. Monetary amounts in accounting are integers. 'BCD' is sometimes used so that decimal fractions round correctly, but the correct method is to use integers. Rational arithmetic is another place for large integers. Numbers are represented as the quotient of two large integers. This is where special hardware might help. Symbolic math often uses rational arithmetic, but the large integers should be variable length. Numbers such as '1' and '2' are far more common than 100 digit monsters. -- Stuart D. Gathman <..!seismo!{vrdxhq|dgis}!BMS-AT!stuart>