UNPKG

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