System.Math.GetRoundMode
Delphi
function GetRoundMode: TRoundingMode;
C++
extern DELPHI_PACKAGE TRoundingMode __fastcall GetRoundMode(void);
Properties
| Type | Visibility | Source | Unit | Parent |
|---|---|---|---|---|
| function | public | System.Math.pas System.Math.hpp |
System.Math | System.Math |
Description
Returns the current floating-point rounding mode.
Call GetRoundMode to ascertain how the floating-point number hardware handles rounding issues.
The value of the rounding mode determines certain rules that can affect the result. With the default rounding mode (rmNearest), if X is exactly halfway between two whole numbers, the result is always the even number.
The rounding mode can be any of the following values.
| Value | Meaning |
|---|---|
|
|
Rounds to the closest integer value. |
|
|
Rounds toward negative infinity. |
|
|
Rounds toward positive infinity. |
|
|
Truncates the value, rounding positive numbers down and negative numbers up. |
See Also
- Floating-Point Number Control Routines
- About Floating-Point Arithmetic
- Floating-Point Rounding Routines