Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!das-news.harvard.edu!news2.near.net!MathWorks.Com!europa.eng.gtefsd.com!howland.reston.ans.net!torn!nott!cunews!dbuck
From: dbuck@superior.carleton.ca (Dave Buck)
Subject: Re: Anything better than Float?
Message-ID: <CxGMMu.8Iu@cunews.carleton.ca>
Sender: news@cunews.carleton.ca (News Administrator)
Organization: Carleton University, Ottawa, Canada
References: <37akc6$4ur$1@melbourne.dialix.oz.au>
Date: Mon, 10 Oct 1994 13:54:30 GMT
Lines: 29

In article <37akc6$4ur$1@melbourne.dialix.oz.au>,
Bradley Tate <btate@melbourne.dialix.oz.au> wrote:
>I would like to do some fairly conventional things in Smalltalk; things like
>administration systems and insurance style work. This can involve some big
>number i.e. several billion dollar type numbers, and from what I've seen
>with my minimal time with IBM's VisualAge and Smalltalk/V Windows the class
>Float is about all there is to work with when one wants currency style
>numbers.
>
>This is a significant problem if one wishes to maintain accuracy and 
>approach program development in a convenient manner. (well, it looks like
>a problem to me)

If you are't worried about fractions of a cent (most money type
programs aren't), you can get as many digits as you like by using
integers instead of floats.  Integers will automatically promote
themselves from small integers to large integers (with an unlimited
number of digits) as required.  Just think of the number as the number
of cents.

David Buck
dbuck@ccs.carleton.ca

_________________________________
| David K. Buck                 |
| dbuck@ccs.carleton.ca         |
| The Object People             |
|_______________________________|
 
