I could have said pounds & pence, or yen ??, the principle holds for most currencies I'm familiar with, in that they use 100 minor:1 major unit.

Granted, if we start talking Yen, you start to loose accuracy in the 100th of a Yen range when totals grow larger than around $750,000,000,000 US dollars equivalent, but that is still larger than the gross national product of most, if not all, countries.

Also, a quick (read: not thorough) investigation shows that most of the currencies that have high number exchange rates - the Yen, South Korean Won, the Italian Lire (deceased) do not have (or possibly no longer use) any minor denomination for their currancies, which makes inaccuracies 100 times less likely.

I also didn't make any assumptions, I simply asked the question. I left it to OP to decide whether that was sufficient precision for his/her purpose. It could be that they work for a clearing bank and handle sums large enough that the cumulative totals require greater precision, although they usually use BCD field in COBOL programs for their calculations.

I only really sought to point out that for most purposes, calculating in pence/cents/other rather than pounds&pence/dollars@cents/other&other allows perls floats to retain accuracy to numbers large enough to total the annual turnover of most companies.


..and remember there are a lot of things monks are supposed to be but lazy is not one of them

Examine what is said, not who speaks.
1) When a distinguished but elderly scientist states that something is possible, he is almost certainly right. When he states that something is impossible, he is very probably wrong.
2) The only way of discovering the limits of the possible is to venture a little way past them into the impossible
3) Any sufficiently advanced technology is indistinguishable from magic.
Arthur C. Clarke.

In reply to Re: Re: Re: Fixed precision numbers by BrowserUk
in thread Fixed precision numbers by iburrell

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.