Xref: utzoo comp.lang.c:27739 comp.sources.wanted:11351 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!ukc!edcastle!aiai!richard From: richard@aiai.ed.ac.uk (Richard Tobin) Newsgroups: comp.lang.c,comp.sources.wanted Subject: Re: Fixed point numeric routines. Message-ID: <2193@skye.ed.ac.uk> Date: 10 Apr 90 20:16:12 GMT References: <3804NU013809@NDSUVM1> <1990Apr7.223842.14425@utzoo.uucp> Reply-To: richard@aiai.UUCP (Richard Tobin) Organization: AIAI, University of Edinburgh, Scotland Lines: 16 >>I assume that what I need are fixed point numeric routines which will >>handle only a finite number of decimal places of precision. >If all amounts are guaranteed to be less than about $20 million, by far >the simplest method is to use `long int' and measure money in pennies. If you need larger amounts, you may find it possible to use floating point *but still do everything in pennies*. A double precision floating point number should be able to store integers of around 50 bits without loss of accuracy. -- Richard -- Richard Tobin, JANET: R.Tobin@uk.ac.ed AI Applications Institute, ARPA: R.Tobin%uk.ac.ed@nsfnet-relay.ac.uk Edinburgh University. UUCP: ...!ukc!ed.ac.uk!R.Tobin