# [Maxima] a .. b

Stavros Macrakis macrakis at alum.mit.edu
Wed Jun 18 11:03:50 CDT 2008

```On Wed, Jun 18, 2008 at 11:03 AM, Barton Willis <willisb at unk.edu> wrote:
> Thanks to everybody for the input. I'll delete the auto ceiling / floor
> code. What about float and big float endpoints?

Why don't we define the properties we want for a..b first.

I think it's clear that we want:
Forall x in a..b, x>=a and x<=b
This implies:
If a>b, then x is empty
If a=b, then either a..b is precisely [a] == [b] or it is empty
Forall x,y in a..b, integerp(x-y)
If integerp(a) then a in a..b
If x in a..b and x+1 <= b then x+1 in a..b
If x in a..b and x-1 >= a then x-1 in a..b

After that, we can choose whether a..b means
A) the integers s.t. a<=x<=b
or
B) all x s.t. x=a+i and a<=x<=b (where i is an integer)

Then

A(a,b) = B(ceiling(a),floor(b))

and

B(a,b) = a-floor(a)+A(floor(a),floor(a)+floor(b-a))

Since defining A in terms of B is easier than the other way around, B
looks better -- and it seems to be what commercial Macsyma does.

-s
```