Show: Delphi C++
Display Preferences

System.Math.GetRoundMode

From RAD Studio API Documentation
Jump to: navigation, search

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

rmNearest

Rounds to the closest integer value.

rmDown

Rounds toward negative infinity.

rmUp

Rounds toward positive infinity.

rmTruncate

Truncates the value, rounding positive numbers down and negative numbers up.

See Also

Code Examples

Personal tools
In Other Languages
Previous Versions
Assistance