RoundDown
RoundDown
RoundDown[ a ] rounds a number down to the nearest integer.
Usages
RoundDown[ a ]
RoundDown[ a ] rounds the value of a down to the nearest integer. a can be any expression with a numerical value, or a quantity with a unit. In a script, wrap the command in Simplify.
| Example | in | out |
|---|---|---|
| A decimal number. | Simplify[ RoundDown[1.9] ] |
1 |
| For negative numbers, rounding down goes away from zero. | Simplify[ RoundDown[-1.2] ] |
-2 |
| A quantity keeps its unit. | Simplify[ RoundDown[Quantity[1.9, 'm']] ] |
Quantity[1, 'm'] |
Details
- Without
Simplify, the command is not calculated. To round down directly in a script, useFloor. - Decimals:
RoundDownalways rounds to an integer.Simplify[ RoundDown[1.234, 2] ]is not calculated; useFloor[ 1.234, 2 ]instead.