OCL Number Operators
No edit summary
No edit summary
Tag: 2017 source edit
 
Line 1: Line 1:
===== Number Operators =====
===== Number Operators =====
In addition to the basic math functions (+, -, /, \*), there are a number of advanced functions. Take note that '''Number''' denotes both '''Integer''' and '''Real''', and they're substitutive unless otherwise specified.
In addition to the basic math functions (+, -, /, \*), there are a number of advanced functions. Take note that '''Number''' denotes both '''Integer''' and '''Real''', and they're substitutive unless otherwise specified.
{| class="wikitable"
!Operators
!Description
|-
|'''[[Documentation:OCLOperators Number::abs () : Number|Number::abs () : Number]]'''
|Returns the absolute value of ''self'', ''self'' if it is already a positive number.
|-
|'''[[Documentation:OCLOperators Number::floor () : Integer|Number::floor () : Integer]]'''
|Returns the integer part of self if it is a Real, self if it is an Integer.
|-
|'''[[Documentation:OCLOperators Number::max ( r : Number ) : Number|Number::max ( r : Number ) : Number]]'''
|Returns the greatest number between self and *r*.
|-
|'''[[Documentation:OCLOperators Number::min ( r : Number ) : Number|Number::min ( r : Number ) : Number]]'''
|Returns the lowest number between ''self'' and *r*.
|-
|'''[[Documentation:OCLOperators Number::round () : Integer|Number::round () : Integer]]'''
|Returns the nearest integer to ''self'' if it is a Real, ''self'' if it is an Integer.
|-
|'''[[Documentation:OCLOperators Number::ieeereminder(r:Number):Integer|Number::ieeereminder(r:Number):Integer]]'''
|Reminder of division with r, ie modulus or mod or %
|-
|'''[[Documentation:OCLOperators Integer::div ( i : Integer ) : Integer|Integer::div ( i : Integer ) : Integer]]'''
|Returns the integer quotient of the division of ''self'' by *i*.
|-
|'''[[Documentation:OCLOperators Integer::mod ( i : Integer ) : Integer|Integer::mod ( i : Integer ) : Integer]]'''
|Returns the integer remainder of the division of ''self'' by *i*.
|}


'''See also''': [[Documentation:OCLOperators|OCLOperators]]
'''See also''': [[Documentation:OCLOperators|OCLOperators]]

Latest revision as of 05:28, 10 March 2025

This page was created by Stephanie@mdriven.net on 2023-04-12. Last edited by Stephanie@mdriven.net on 2025-03-10.
Number Operators

In addition to the basic math functions (+, -, /, \*), there are a number of advanced functions. Take note that Number denotes both Integer and Real, and they're substitutive unless otherwise specified.

See also: OCLOperators

MDriven Chat

How would you like to chat today?

Setting up your conversation…

This may take a few moments