UNPKG

1.05 kBMarkdownView Raw
1<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
2
3# Function floor
4
5Round a value towards minus infinity.
6For matrices, the function is evaluated element wise.
7
8
9## Syntax
10
11```js
12math.floor(x)
13```
14
15### Parameters
16
17Parameter | Type | Description
18--------- | ---- | -----------
19`x` | number &#124; BigNumber &#124; Fraction &#124; Complex &#124; Array &#124; Matrix | Number to be rounded
20
21### Returns
22
23Type | Description
24---- | -----------
25number &#124; BigNumber &#124; Fraction &#124; Complex &#124; Array &#124; Matrix | Rounded value
26
27
28## Examples
29
30```js
31math.floor(3.2) // returns number 3
32math.floor(3.8) // returns number 3
33math.floor(-4.2) // returns number -5
34math.floor(-4.7) // returns number -5
35
36const c = math.complex(3.2, -2.7)
37math.floor(c) // returns Complex 3 - 3i
38
39math.floor([3.2, 3.8, -4.7]) // returns Array [3, 3, -5]
40```
41
42
43## See also
44
45[ceil](ceil.md),
46[fix](fix.md),
47[round](round.md)