a .. b



I wonder what the right thing to do about possible round-off errors in
a..b is.   For integer a, b, clearly a..b has b-a+1 elements. For
floats, if b-a+1 is a tad less than an integer, should it round up?
Perhaps controlled by ratepsilon?

Or should we be strict: caveat emptor?

For that matter, what exactly should be the definition of a..b or
a..del..b in approximate arithmetic? Is it a, a+del, (a+del)+del, ...
or a, a+1*del, a+2*del, ... or even
float(rationalize(a)+i*rationalize(del)) i.e. the best approximation
to the exact number? Is the termination condition based on a count or
on a comparison of the nth result to b? Is the nth value a+... or
exactly b?

         -s

       -s





On 6/28/08, Barton Willis <willisb at unk.edu> wrote:
> My updated my dot-dot code is in CVS (/contrib/integer_sequence); demo:
>
> (%i13) 0 .. 2 .. 11;
> (%o13) [0,2,4,6,8,10]
> (%i14) 0 .. 11;
> (%o14) [0,1,2,3,4,5,6,7,8,9,10,11]
> (%i15) 0 .. 0.1 .. 1;
> (%o15) [0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0]
>
> Barton
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>

-- 
Sent from Gmail for mobile | mobile.google.com