Ceil - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.

Online Help

All Products    Maple    MapleSim


Trunc

truncate a number to the next nearest integer multiple of a given real number

Round

round a number to the nearest integer multiple of a given real number

Floor

greatest integer multiple less than or equal to a  given number

Ceil

smallest integer multiple greater than or equal to a given number

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

Trunc(x, alpha)

Round(x, alpha)

Floor(x, alpha)

Ceil(x, alpha)

Parameters

x

-

any expression

alpha

-

a nonzero real number

Description

• 

These functions compute integer multiples of alpha near to x

– 

Floor returns the greatest integer multiple of x less than or equal to alpha

– 

Ceil returns the least integer multiple of x greater than or equal to alpha

– 

Round returns the integer multiple of alpha nearest to x

– 

Trunc returns trunc⁡xα·α, i.e. whichever of the Floor or Ceil that is closer to 0.

• 

All these functions call their lowercase name equivalents on xα and so behave the same for nonreal, and nonconstant values of x. See trunc for those details.

Examples

A common use case is to find a nearest multiple of 1000 to round to 3 digits e.g.

> 

Trunc⁡75341,1000

75000

(1)
> 

Ceil⁡75341,1000

76000

(2)
> 

Trunc⁡−75341,1000

−75000

(3)
> 

Floor⁡−75341,1000

−76000

(4)
> 

Floor⁡−75341,−1000

−76000

(5)

The second argument α does not have to be an integer; we can round to the nearest multiple of π or any real constant.

> 

Round⁡11.1,π

4⁢π

(6)
> 

Floor⁡sqrt⁡3,π4

π2

(7)

Another application is doing unit conversions with rounding.

> 

Ceil⁡14⁢Unit⁡m,Unit⁡inches

552⁢in

(8)

These commands support a symbolic first argument, but the second argument must be a nonzero real constant.

> 

Floor⁡x,10

10⁢x10

(9)
> 

Floor⁡x,−10

10⁢x10

(10)
> 

Floor⁡10,x

Error, (in Floor) invalid input: 2nd argument, alpha, expected to be a real number with or without a unit but received, x

Compatibility

• 

The Trunc, Round, Floor and Ceil commands were introduced in Maple 2025.

• 

For more information on Maple 2025 changes, see Updates in Maple 2025.

See Also

trunc, round, floor, and ceil