On Thu, Apr 2, 2009 at 6:48 PM, Jack Foy <span dir="ltr">&lt;<a href="mailto:jack@foys.net">jack@foys.net</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
This may be part of your longer answer: wouldn&#39;t integer calculations in<br>
fractional cents (to two or three decimal places) be closer to a<br>
real-world solution?</blockquote><div> </div>No, you want to do calculations in units of pennies and round to the nearest penny (using banker&#39;s rounding) whenever you calculate a value that will be displayed to the customer (unless you are displaying values other than to the nearest penny, which is rare but not unheard of).<br>
<br>And you make these calculation in floating point, which is what Perl does even if you use int() (but don&#39;t &quot;use integer;&quot;).<br><br><div class="gmail_quote">Tye<br></div>