skip to main content
Corticon Studio: Rule Language Guide : Categories of rule operators : Attribute operators : Integer
 

Try Corticon Now
Integer
In this section, wherever the syntax includes <Number>, either Integer or Decimal data types may be used.
Corticon's Integer attribute operators are as follows:
Name and Syntax
Returns
Description
Equals (used as a comparison)
<Number1> = <Number2>
Boolean
Returns a value of true if <Number1> is the same as <Number2>.
Equals (used as an assignment)
<Number1> = <Number2>
Number
Assigns the value of <Number2> to the value of <Number1>. The data type of <Number1> must be expansive enough to accommodate <Number2>.
<Number1> <> <Number2>
Boolean
Returns a value of true if <Number1> is not equal to <Number2>.
<Number1> < <Number2>
Boolean
Returns a value of true if <Number1> is less than <Number2>.
<Number1> > <Number2>
Boolean
Returns a value of true if <Number1> is greater than <Number2>.
<Number1> <= <Number2>
Boolean
Returns a value of true if <Number1> is less than or equal to <Number2>.
<Number1> >= <Number2>
Boolean
Returns a value of true if <Number1> is greater than or equal to <Number2>.
attributeReference in [ |(rangeExpression)|]
Boolean
Returns a value of true if attributeReference is in the range of Integer values from..to, and where opening and closing parentheses ( )indicate exclusion of that limit and square brackets [ ] indicate inclusion of that limit.
attributeReference in {listExpression}
Boolean
Returns a value of true if attributeReference is in the comma-delimited list of literal values, defined enumeration values, or - if in use - enumeration labels.
<Number1> + <Number2>
Number
Returns the sum of <Number1> and <Number2>. The resulting data type is the more expansive of either <Number1> or <Number2>. For example, if an Integer value is added to a Decimal value, the resulting value will be a Decimal. See Precedence of rule operators.
<Number1> - <Number2>
Number
Subtracts <Number2> from <Number1>. The resulting data type is the more expansive of either <Number1> or <Number2>. See Precedence of rule operators.
<Number1> * <Number2>
Number
Returns the product of <Number1> and <Number2>. The resulting data type is the more expansive of either <Number1> or <Number2>. See Precedence of rule operators.
<Number1> / <Number2>
Number
Divides <Number1> by <Number2>. The resulting data type is the more expansive of either <Number1> or <Number2>. See Precedence of rule operators.
<Number1> += <Number2>
Number
Increments <Number1> by <Number2>. The data type of <Number1> must accommodate the addition of <Number2>. See Precedence of rule operators.
<Number1> -= <Number2>
Number
Decrements <Number1> by the value of <Number2>. The data type of <Number1> must accommodate the addition of <Number2>. See Precedence of rule operators.
<Integer>.absVal
Number
Returns the absolute value of <Integer>. If the <Integer> is positive, <Integer> itself is returned; if <Integer> is negative, the negation of <Integer> is returned.
<Integer>.toDecimal
Decimal
Converts an attribute of type Integer to type Decimal.
<Integer>.toString
String
Converts an attribute of type Integer to type String.
<Integer1>.max(<Integer2>)
Integer
Returns the greater of <Integer1> and <Integer2>.
<Integer1>.min(<Integer2>)
Integer
Returns the lesser of <Integer1> and <Integer2>.
<Integer1>.div(<Integer2>)
Integer
Returns the whole number of times that <Integer2> fits within <Integer1> - any remainder is discarded.
<Integer1>.mod(<Integer2>)
Integer
Returns the whole number remainder that results from dividing <Integer1> by <Integer2>. If the remainder is a fraction, then zero is returned.
Logarithm (base 10)
<Integer>.log
Decimal
Returns the logarithm (base 10) of <Integer>. <Integer> may not be zero.
Logarithm (base x)
<Integer>.log(<Decimal>)
Decimal
Returns the logarithm (base <Decimal>) of <Integer>. <Integer> may not be zero.
<Integer>.ln
Decimal
Returns the natural logarithm (base e) of <Number>. <Integer> may not be zero.
isProbablePrime(certainty)
<Integer>.isProbablePrime (certainty:Integer)
Boolean
Returns true if this Integer is probably prime; false if definitely is not prime.
gcd(val)
<Integer>.gcd(val:Integer)
Integer
Returns the greatest common divisor of the absolute value of this and the absolute value of val.
negate
<Integer>.negate
Integer
Returns the negative value of this integer.