math.setRoundMode you can set the FPU’s method of rounding.
If no FPU is present, the global variable
system.softFloat_rounding_mode will determine the rounding mode for floating-point operations implemented by software.
This also affects the run-time behavior of the
(Note, constant expressions can and will be evaluated during compile-time, thus the presented techniques do not affect compile-time results.)
SetRoundMode is a unary function.
The function’s signature reads:
function setRoundMode(const roundMode: TFPURoundingMode): TFPURoundingMode
The following values are permissible for
- rounds to the nearest even integer (Banker‘s Rounding:
0.5rounds down to
1.5rounds up to
2). This is the default.
- generally rounds to the next smaller integer
- generally rounds to the next larger integer
- cuts off the decimal places
The function will return the previous rounding mode, before it was changed.
Thus, it returns the same value as