From: Mark Probert Date: 2002-12-28T12:59:57+09:00 Subject: Re: 1210 / 100 = 12? what? Hi, Mark. At 04:12 AM 12/28/2002 +0900, you wrote: >... why one might want to use fixed point rather than floating point >arithmetic You basically have it: speed and accuracy (for some types of calculations). If you know the scaling factor that you are going to use, then the use of fixed point can be a big speed factor, if you don't have floating point acceleration. If you do, then your mileage will vary, as will your accuracy. For a modern general purpose computer, that means that fixed point is mostly useful for accuracy -- none of the lingering doubts about rounding errors. On an embedded micro-controller, where cycles and/or memory are precious, then fixed point is the way to go. Personally, if I can get away with fixed point, then I will use it. The other part of your question, the part about remainders, deals with scaling. If I do: 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. Hope this helps a little. -mark ----- Mark Probert GNPS - Optera Metro 3000 Tel (613) 768-1082 (ESN: 398-1082) Mob (613) 715-2045 email: probertm@nortelnetworks.com