On Thu, Apr 12, 2007 at 05:06:48PM -0400, Stavros Macrakis wrote:
> On 4/12/07, Henning Siebel <henning.siebel at gmx.de> wrote:
> >
> >Michel Van den Bergh <michel.vandenbergh <at> uhasselt.be> writes:
> >http://www2.hursley.ibm.com/decimal:
> >
> >> "binary floating-point arithmetic should not be used for financial,
> >> commercial, and user-centric applications"
> >
>
> Note that "scientific and mathematical" applications are not mentioned
> here. And indeed, binary floating-point is the standard arithmetic in those
> domains. It's not clear what is meant here by "user-centric"; surely not
> simply non-system software.
When it comes down to it, you'll find that the median person rarely
calculate with numbers other than for accounting purposes or the
occasional "how many square feet of flooring do I have to buy" or
"what's my BMI after my 3 week diet". So really "user-centric" is
going to be close to "accounting".
Many of the calculators you'll see on people's desks are the
"+,-,*,/,=" variety.
> But your original question did set into motion an interesting discussion. I
> still think that the conclusion for now is very simple: set the default
> number of digits to print as 15 (or even 14) rather than 16.
I vote for fpprintprec = 6. How often do you really want to see
2.71828182845905 vs just 2.71828. For those who care it's not too hard
to figure out how to get more. For reference, the statistical software
"R" uses an equivalent of fpprintprec = 7 even though it uses double
floats. An example interation in R:
> sqrt(2)
[1] 1.414214
> sqrt(2)*sqrt(2)
[1] 2
> sprintf("%.16f",sqrt(2)*sqrt(2))
[1] "2.0000000000000004"
>
(the [1] means it's a vector of 1 element)
--
Daniel Lakeland
dlakelan at street-artists.org
http://www.street-artists.org/~dlakelan