infinity, nan, etc redundant, also exact decimal arithmetic



The primary reason for preferring exact decimal arithmetic is that it is
less surprising than rationals for people who are naive computationally.
For example, when you type in 0.4, you would be surprised, and probably
annoyed, to see 2/5.

It is closer to what we learned as "scientific notation".

It might foreclose some of the typical naive questions protesting that your
big powerful CAS can't even do elementary-school arithmetic correctly.  And
after all, if we can do scientific notations, why not?
What do we allow "64-bit IEEE float" to dictate what we can represent in a
computer with a gigabyte of memory?

Also, it is possible to associate with numbers "format strings"  so they can
be printed in some format like common lisp e,f,g directives. Though whether
it is sensible to propagate these formats through
operations, I haven't decided.  (what is the format of an f-formatted float
+ an e-formatted float??)


Also, if you ask  is( 1e100+1e0 > 1e100)  you might prefer True.

This is not the same as decimal bigfloats.  This arithmetic does not have a
pre-set maximum precision that is carried, at least for + * -:  it is, to
the extent possible, "full precision"  and thus closer computationally to
rational numbers, but as you say, a subset, excluding those numbers whose
denominators are not factors of integer powers of 10. 

 At some junctures you have to give up this claim about full precision,
like sin()  or even division like 1/3. At that point something has to give.

Attempting to write out the conversions for unary and binary operations
leaves lots of choices; making these explicit to the user might be useful.
e.g. does sin(decimal) come out as a double-float, or a bigfloat (what
precision?) or even converted back to decimal.  Some decisions can go to
defaults, e.g.  decimal * interval.


RJF
  

> -----Original Message-----
> From: Stavros Macrakis [mailto:macrakis at gmail.com] 
> Sent: Tuesday, September 05, 2006 7:12 AM
> To: fateman at cs.berkeley.edu
> Cc: maxima at math.utexas.edu
> Subject: Re: [Maxima] infinity, nan, etc redundant, also 
> exact decimal arithmetic
> 
> On 9/4/06, Richard Fateman <fateman at cs.berkeley.edu> wrote:
> > Also, I've written out some programs that do decimal 
> arithmetic which 
> > is exact and closed under + and *, and has exact output.
> 
> That is nice, but why is it better than using rationals?  
> After all, it is a strict subset of the rationals.  If it is 
> nice to have 0.1+0.1=0.2, isn't even nicer to have 0.1+1/3 = 
> 11/30?  I suppose the arithmetic is faster in decimal 
> bigfloats, and output conversion is simpler, but is that 
> worth adding another data type?
>