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
Trunc(x, alpha)
Round(x, alpha)
Floor(x, alpha)
Ceil(x, alpha)
x
-
any expression
alpha
a nonzero real number
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 truncxα·α, 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.
A common use case is to find a nearest multiple of 1000 to round to 3 digits e.g.
Trunc75341,1000
75000
Ceil75341,1000
76000
Trunc−75341,1000
−75000
Floor−75341,1000
−76000
Floor−75341,−1000
The second argument α does not have to be an integer; we can round to the nearest multiple of π or any real constant.
Round11.1,π
4π
Floorsqrt3,π4
π2
Another application is doing unit conversions with rounding.
Ceil14Unitm,Unitinches
552in
These commands support a symbolic first argument, but the second argument must be a nonzero real constant.
Floorx,10
10x10
Floorx,−10
Floor10,x
Error, (in Floor) invalid input: 2nd argument, alpha, expected to be a real number with or without a unit but received, x
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
Download Help Document