Core.Terms.Round

From emotive
Jump to navigation Jump to search

Classification

Name Round
Short Description Returns the rounded integer value of the operand
Class Term
Extension OTX Core library
Group Operations
Exceptions -
Checker Rules -
Standard Compliant Yes

OTL Syntax

NumericValue = Round(NumericTerm);

Description

Round is a NumericTerm which returns the rounded integer value of the operand.

Return Value

The Term returns the value, see table below.

Icons Note.png In OTX, Terms are categorized according to its return data type!
Data Type Description
Integer, Float The rounded integer value of the operand.

Properties

Name Data Type Class Default Cardinality Description
Numeral Integer, Float Term - [1] The numeric term that shall be rounded to the nearest integer towards plus infinity.

OTL Examples

/// Local Declarations

Float MyValue1 = -123.456;
Integer Result1;

/// Flow

// Below expression should return -122
Result1 = Round(MyValue1);
// Below expression should return 1
Result1 = Round(0.1);
// Below expression should return -1
Result1 = Round(-1.9);
// Below expression should return 2
Result1 = Round (1.234);

See also

Add
Subtract
Multiply
Divide
Modulo
AbsoluteValue
Negate