And from Wikipedia on the Vancouver Stock Exchange.
"The history of the exchange's index provides a standard case example of
large errors <https://en.wikipedia.org/wiki/Round-off_error> arising from
seemingly innocuous floating point calculations. In January 1982 the index
was initialized at 1000 and subsequently updated and truncated
<https://en.wikipedia.org/wiki/Truncation> to three decimal places on each
trade. Such a thing was done about 3000 times each day. The accumulated
truncations led to an erroneous loss of around 25 points per month. Over
the weekend of November 25–28, 1983, the error was corrected, raising the
value of the index from its Friday closing figure of 524.811 to 1098.892"

On Sun, Jan 26, 2020 at 11:20 AM Robert Engels <reng...@ix.netcom.com>
wrote:

> Just an FYI, often that is not correct. Many financial systems require
> fractional pennies due to the volume of transactions. Think about taxing
> stock exchanges.... the pennies add up quickly at any tax rate, so they use
> fractional pennies to reduce the size of the error bucket.
>
> On Jan 26, 2020, at 8:50 AM, Pat Farrell <pat22...@gmail.com> wrote:
>
> 
> never use floating point if you are trying to represent money, say dollars
> and cents or decimal values of the euro.
> Store the money as integer number of pennies.
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/cc852ce3-6f88-40fd-8b19-877c76deec10%40googlegroups.com
> <https://groups.google.com/d/msgid/golang-nuts/cc852ce3-6f88-40fd-8b19-877c76deec10%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/AF9827F5-C849-4F4E-8229-005D6C9A0E03%40ix.netcom.com
> <https://groups.google.com/d/msgid/golang-nuts/AF9827F5-C849-4F4E-8229-005D6C9A0E03%40ix.netcom.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAOUkXSptfibw5D4UqwORhZLH8%2BV9s24Os-SjSp5RH2OLUN%2Bn1g%40mail.gmail.com.

Reply via email to