Libraries.Language.Types.Number Documentation
The Number class is the object representation of the primitive type number.
Example Code
class Main
action Main
number age = 15.5
Number result = test(age)
end
action test(Number num) returns Number
return num
end
end
Inherits from: Libraries.Language.Object
Summary
Actions Summary Table
Actions | Description |
---|---|
Compare(Libraries.Language.Object object) | This action compares two object values and returns an integer. |
Equals(Libraries.Language.Object object) | This action determines if two objects are equal based on their values. |
GetHashCode() | This action gets the hash code for an object. |
GetHex() | This action gets the hex representation of the number value. |
GetInteger() | This action gets the value from the number object and casts it to an integer. |
GetMaximumValue() | This action gets the maximum number value, (2-2^-52)*2^1023. |
GetMinimumPositiveValue() | This action gets the minimum number value (4. |
GetMinimumValue() | This action gets the minimum negative number value (-1. |
GetNegativeInfinityValue() | This action gets the negative infinity of a number value(0xfff0000000000000L). |
GetNotANumberValue() | This action gets the not-a-number representation of a number value. |
GetNumberOfBits() | This action gets the number of bits representing a number value. |
GetPositiveInfinityValue() | This action gets the positive infinity number value(0x7ff0000000000000L). |
GetText() | This action gets the value from the number object and casts it to a text value. |
GetValue() | This action gets the value from the number object. |
IsInfinite() | This action returns true if the number is infinite. |
IsNotANumber() | This action returns true if the number is not a number(NaN). |
SetValue(number i) | This action sets the value of the number object. |
Actions Documentation
Compare(Libraries.Language.Object object)
This action compares two object values and returns an integer. The compare result is either larger if this hash code is larger than the object passed as a parameter, smaller, or equal.
Example Code
Number o
Number t
integer result = o:Compare(t) //1 (larger), 0 (equal), or -1 (smaller)
Parameters
- Libraries.Language.Object: The object to compare to.
Return
integer: The Comprare result, Smaller (-1), Equal (0), or Larger (1).
Equals(Libraries.Language.Object object)
This action determines if two objects are equal based on their values.
Example Code
Number o
Number t
boolean result = o:Equals(t)
Parameters
- Libraries.Language.Object: The to be compared.
Return
boolean: True if the values are equal and false if they are not equal.
GetHashCode()
This action gets the hash code for an object. In this case, GetHashCode is overriden and matches the integer value of the equivalent primitive in the Java programming language.
Example Code
Object o
integer hash = o:GetHashCode()
Return
integer: The integer hash code of the object.
GetHex()
This action gets the hex representation of the number value.
Example Code
number i = 3
text result = i:GetHex()
Return
text: The hex representation of the number.
GetInteger()
This action gets the value from the number object and casts it to an integer.
Example Code
Number age
integer result = age:GetInteger()
Return
integer: The value of the object converted to an integer.
GetMaximumValue()
This action gets the maximum number value, (2-2^-52)*2^1023.
Example Code
number i = 3.5
output i:GetMaximumValue()
Return
number: The maximum number value.
GetMinimumPositiveValue()
This action gets the minimum number value (4.9e-324). This is the smallest possible positive number.
Example Code
number i = 3.5
output i:GetMinimumPositiveValue()
Return
number: The minimum number value.
GetMinimumValue()
This action gets the minimum negative number value (-1.7976931348623157E308).
Example Code
number i = 3.5
output i:GetMinimumValue()
Return
number: The minimum number value.
GetNegativeInfinityValue()
This action gets the negative infinity of a number value(0xfff0000000000000L).
Example Code
number i = 3.5
output i:GetNegativeInfinityValue()
Return
number: Negative infinity of a number value.
GetNotANumberValue()
This action gets the not-a-number representation of a number value.
Example Code
number i = 3.5
output i:GetNotANumberValue()
Return
number: The Not-a-Number of a number value.
GetNumberOfBits()
This action gets the number of bits representing a number value.
Example Code
number i = 3.5
output i:GetNumberOfBits()
Return
integer: The number of bits of a number value.
GetPositiveInfinityValue()
This action gets the positive infinity number value(0x7ff0000000000000L).
Example Code
number i = 3.5
output i:GetPositiveInfinityValue()
Return
number: The positive infinity of a number.
GetText()
This action gets the value from the number object and casts it to a text value.
Example Code
Number age
text result = age:GetText()
Return
text: The value of the object converted to text.
GetValue()
This action gets the value from the number object.
Example Code
Number age
number result = age:GetValue()
Return
number: The value of the object.
IsInfinite()
This action returns true if the number is infinite.
Example Code
number i = 333.999999999999999999
boolean result = i:IsInfinite()
Return
boolean: True if the number is infinitely large and false if it is not.
IsNotANumber()
This action returns true if the number is not a number(NaN).
Example Code
number i = 3.5
boolean result = i:IsNotANumber()
Return
boolean: True if NaN.
SetValue(number i)
This action sets the value of the number object.
Example Code
Number age
age:SetValue(15.5)
Parameters
- number i: The number value.