Simplification of products and the number 0



  On 10/13/2010 3:56 PM, Richard Fateman wrote:
>  I..snip...  continuing

if  0.0 * 0  -->  0.0   then
it seems to me that

1.0 * 0   should be 0.0,   not 0.

I suppose this could be programmed, too.

The initial notion that all numbers are exact, and that floats should be 
converted to
rationals when they first appear, has a certain appeal, but it does not 
work if
you use exp, log, sin, cos ...

Also, the length of rational numbers grows as you do arithmetic, slowing 
everything
down.  But at least the answers under rational operations are indisputable.

That's why  rat()  by default does the conversion of floats to rationals.


The other direction of conversion to the subset of the rationals that can be
represented by floats or bfloats, has lots of problems, since you can now
overflow, underflow, and lose precision.  Most programs lack any adequate
way of handling these situations.  Perhaps before we start converting to
floats, we should be clear on how to deal with over/underflow, and what
to do with (say)  exp or log  of NaN, too.

RJF