From: Mark Probert Date: 2002-12-29T01:51:48+09:00 Subject: Re: 1210 / 100 = 12? what? At 01:45 PM 12/28/2002 +0900, transami wrote: > > irb: 1210 / 100 # 12 > > irb: 1210 % 100 # 10 (scaled: 10 / 100) > > > > So, if I was working in dollars and cents (scaled to cents), then the > > modulus returns me the working number of cents. > >interesting approach. is this a standard approach in finacial applications? i >may use this. Some do, where there is a need for speed and accuracy and there is no in-built language support for a Currency type. The usual practice would be to use 1000 rather than 100 as a scaler. This gives accuracy to $0.0001, which takes into account things like fractional interest rates used in bonds, futures and so on. Regards, -mark.