floor, ceiling, and friends
- Subject: floor, ceiling, and friends
- From: Barton Willis
- Date: Thu, 14 Jul 2005 00:54:57 -0500
What: New or improved functions compare, charfun, ceiling,
floor, and nummod. The zip file has the source,
a usage file, and rtest files.
Where: http://www.unk.edu/facstaff/profiles/willisb/
Examples:
(%i1) load("c:/maxima/nummod/nummod.lisp")$
(%i2) floor(ceiling(x));
(%o2) CEILING(x)
(%i3) declare(n,integer)$
(%i4) [floor(n), floor(n!), floor(max(n,8))];
(%o4) [n,n!,MAX(n,8)]
(%i5) floor(10 * %pi);
(%o5) 31
(%i6) nummod(8,3);
(%o6) 2
(%i7) nummod(8,4);
(%o7) 0
(%i8) 8 - 2 * floor(8/2);
(%o8) 0
(%i9) nummod(a*x,a*y);
(%o9) a*NUMMOD(x,y)
(%i11) compare(5,9);
(%o11) <
(%i12) compare(x,x);
(%o12) =
(%i14) f(x) := charfun(x <= 1)$
(%i15) [f(0.2),f(1),f(101/100)];
(%o15) [1,1,0]
Barton