|
Boost : |
From: Bill Seymour (bsey_at_[hidden])
Date: 2001-05-22 08:08:22
Although the demands of my day job have made it difficult
to work on the code for the last couple of weeks, I've
followed these e-mail messages with some interest and
learned from them.
I've also had discussions with a couple of accountants,
including a professor at Washington University in St. Louis,
and I've come to the conclusion that rounding techniques
are not specified in any kind of standard (except, possibly,
individual businesses' SOPs), but rather are handed down
as tribal lore. Indeed, the only normative reference I
could find is in a European standard for converting between
Euros and other EU currencies.
So I think I've come to the conclusion that I must supply
the entire zoo of rounding modes and let the user decide
which to use for any given calculation.
I'm still wondering whether to make the rounding mode part
of the static type of an object (as char_traits<> is to
basic_string<>), or some globally-available singleton
(analagous to the global locale). I think I've heard
good arguments for and against both.
I'm leaning strongly towards the second solution. Consider,
for example, the we don't really have case-sensitive and
case-insensitive string comparisons in C++. What we have
instead are case-sensitive and case-insensitive strings.
The latter actually seems like gibberish to me; but I'm
willing to hear arguments to the contrary.
--Bill Seymour
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk