Sponsored links: Algebra eBooks
 

Help Index

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

Y

Z

The Maxima on-line user's manual

Algebra Calculator

Search:

Floor Calculator

Floor

Function: floor (<x>) When <x> is a real number, return the largest integer that is less than or equal to <x>.

define_variable (foo, 0, float);
fpprec : 600;
for m:301 step 1 thru 310 do(foo: bfloat(sum(k^m/3^k,k,1,2100)),foo: foo-floor(foo),disp(m,foo));

If <x> is a constant expression (10 * %pi, for example), floor evaluates <x> using big floating point numbers, and applies floor to the resulting big float. Because floor uses floating point evaluation, its possible, although unlikely, that floor could return an erroneous value for constant inputs. To guard against errors, the floating point evaluation is done using three values for fpprec.

For non-constant inputs, floor tries to return a simplified value. Here are examples of the simplifications that floor knows about:

          (%i1) floor (ceiling (x));
          (%o1)                      ceiling(x)
          (%i2) floor (floor (x));
          (%o2)                       floor(x)
          (%i3) declare (n, integer)$
          (%i4) [floor (n), floor (abs (n)), floor (min (n, 6))];
          (%o4)                [n, abs(n), min(n, 6)]
          (%i5) assume (x > 0, x < 1)$
          (%i6) floor (x);
          (%o6)                           0
          (%i7) tex (floor (a));
          $$\left \lfloor a \right \rfloor$$
          (%o7)                         false

The function floor does not automatically map over lists or matrices. Finally, for all inputs that are manifestly complex, floor returns a noun form.

If the range of a function is a subset of the integers, it can be declared to be integervalued. Both the ceiling and floor functions can use this information; for example:

          (%i1) declare (f, integervalued)$
          (%i2) floor (f(x));
          (%o2)                         f(x)
          (%i3) ceiling (f(x) - 1);
          (%o3)                       f(x) - 1

(%o1)                                true
(%i2) 

Floor Example

Related Examples

floor-sum

n:50 /*S1の項数n●●●*/;

S1:sum(k/(k+1)-(k+1)/...

m:2*n /*S2,S3の項数m●●●*/;

Calculate

floor-rhs-solve-sqrt-tan

alphaG:32.59;

a:5.39;

2/* Wie groß ist der ...

Calculate

floor-plot2d
plot2d([floor(x)+floor(-x)],[x,-10,10]);

plot2d([floor(x)+floo...

Calculate

floor-length-load-sum

Aufgabe:"Uebungen zum...

x:[3,4,3,1,3,3,5,2,5,...

n:length(x) /* Wie vi...

Calculate

floor-plot2d-sum
plot2d(g(x),[x,1,10]);

f(x):=x^2;

g(x):=sum(i*f(i),i,1,...

plot2d(g(x),[x,1,10]);

Calculate

floor

x /* sei die Anzahl d...

for x:1 thru 20000 do...

Calculate

floor-log-numer

""/* AUFGABE A */;

Ko:1000;

p:8;

Calculate

floor-limit-plot2d
plot2d(y(x),[x,-5,5]);

c(x) := x-floor(x);

y(x) := floor(x)+c(x^2);

x0: -1;

Calculate

floor-plot2d-sin
plot2d(floor(x)*sin(%pi*x),[x,-50,50]);

c(x) := x-floor(x);

plot2d(floor(x)*sin(%...

Calculate

floor

Ko:1000;

p:13;

n:14;

Calculate