bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Strange bug


From: Mark H. Weaver
Subject: Re: Strange bug
Date: 21 Jan 2001 23:48:04 -0500
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.0.95

hacksaw@FISHFISHFISHhacksaw.org (Hacksaw) writes:

> Like the fact that the IEEE representation of decimal fraction of
> terminating numbers much small than the operational limits of the
> machine is never the less inaccurate unless it happens to have a 5 in
> it's prime factorization?
> 
> It seems to be a monument to stupidity.
> 
> It can't accurately represent 0.1. Why is this considered useful?

1/10 is a non-terminating number in binary:

0.0001100110011001100110011001100110011001100110011001100110011001100 [...]

> Allow me to change my "bug report" to a query: Is there a bignum
> package for emacs that supercedes all the regular operators so the if
> I add a bunch of prices, I don't get strange numbers?

bignums won't help you unless they represent numbers in a radix in
which 1/10 is a terminating number.  You'd need something which
represents rational numbers.

Might I suggest that you do arithmetic on the cents instead of the
dollars?

        Mark



reply via email to

[Prev in Thread] Current Thread [Next in Thread]