FloatingLong
This class was added by a mod with mod-id mekanism. So you need to have this mod installed if you
want to use this feature.
Importing the class
It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.
import mods.mekanism.api.FloatingLong;Static Methods
Creates a FloatingLong representing the given double.
Return Type: FloatingLong
FloatingLong.create(value as double) as FloatingLong| Parameter | Type | Description |
|---|---|---|
Parameter value | Type double | Description Double to convert |
Creates a FloatingLong representing the given long.
Return Type: FloatingLong
FloatingLong.create(value as long) as FloatingLong| Parameter | Type | Description |
|---|---|---|
Parameter value | Type long | Description Long to convert |
Creates a FloatingLong representing the given string representation.
Return Type: FloatingLong
FloatingLong.create(value as string) as FloatingLong| Parameter | Type | Description |
|---|---|---|
Parameter value | Type string | Description String to parse |
Creates a FloatingLong representing the given unsigned long.
Return Type: FloatingLong
FloatingLong.createFromUnsigned(value as long) as FloatingLong| Parameter | Type | Description |
|---|---|---|
Parameter value | Type long | Description Unsigned long to convert |
Casters
| Result type | Is Implicit |
|---|---|
Result type string | Is Implicit true |
Methods
Adds the given FloatingLong to this FloatingLong and returns the result in a new object.
This
gets clamped at the upper bound of 18,446,744,073,709,551,615.9999 instead of overflowing.
Returns: The FloatingLong representing the value of adding the given FloatingLong to this FloatingLong.
Return Type: FloatingLong
FloatingLong.add(toAdd as FloatingLong) as FloatingLong| Parameter | Type | Description |
|---|---|---|
Parameter toAdd | Type FloatingLong | Description The FloatingLong to add. |
Converts this floating long to a string
Return Type: string
// FloatingLong.asString() as string
myFloatingLong.asString();Compares this FloatingLong to the given FloatingLong.
Returns: 0 if equal to toCompare
An integer< 0 if smaller than toCompare
An integer > 0 if bigger than toCompare
Return Type: int
FloatingLong.compareTo(toCompare as FloatingLong) as int| Parameter | Type | Description |
|---|---|---|
Parameter toCompare | Type FloatingLong | Description The FloatingLong to compare to. |
Divides this FloatingLong by the
given FloatingLong and returns the result in a new object. This
gets clamped at the upper bound of 18,446,744,073,709,551,615.9999 instead of overflowing.
Returns: The FloatingLong representing the value of dividing this FloatingLong by the given FloatingLong.
Return Type: FloatingLong
FloatingLong.divide(toDivide as FloatingLong) as FloatingLong| Parameter | Type | Description |
|---|---|---|
Parameter toDivide | Type FloatingLong | Description The FloatingLong to divide by. |
Checks if this FloatingLong is equal to the given FloatingLong.
Returns: true if this FloatingLong is equal to the
given FloatingLong, false otherwise.
Return Type: boolean
FloatingLong.isEqual(toCompare as FloatingLong) as boolean| Parameter | Type | Description |
|---|---|---|
Parameter toCompare | Type FloatingLong | Description The FloatingLong to compare to. |
Multiplies the given FloatingLong with
this FloatingLong and returns the result in a new object. This
gets clamped at the upper bound of 18,446,744,073,709,551,615.9999 instead of overflowing.
Returns: The FloatingLong representing the value of multiplying the given FloatingLong with this FloatingLong.
Return Type: FloatingLong
FloatingLong.multiply(toMultiply as FloatingLong) as FloatingLong| Parameter | Type | Description |
|---|---|---|
Parameter toMultiply | Type FloatingLong | Description The FloatingLong to multiply by. |
Subtracts the given FloatingLong from this FloatingLong and returns the result in a new object. This gets clamped at the lower bound of 0 rather than becoming negative.
Returns: The FloatingLong representing the value of subtracting the given FloatingLong from this FloatingLong.
Return Type: FloatingLong
FloatingLong.subtract(toSubtract as FloatingLong) as FloatingLong| Parameter | Type | Description |
|---|---|---|
Parameter toSubtract | Type FloatingLong | Description The FloatingLong to subtract. |
Operators
Subtracts the given FloatingLong from this FloatingLong and returns the result in a new object. This gets clamped at the lower bound of 0 rather than becoming negative.
floatingLongOne - floatingLongTwoAdds the given FloatingLong to this FloatingLong and returns the result in a new object.
floatingLongOne + floatingLongTwoMultiplies the given FloatingLong with
this FloatingLong and returns the result in a new object. This
gets clamped at the upper bound of 18,446,744,073,709,551,615.9999 instead of overflowing.
floatingLongOne * floatingLongTwoDivides this FloatingLong by the
given FloatingLong and returns the result in a new object. This
gets clamped at the upper bound of 18,446,744,073,709,551,615.9999 instead of overflowing.
floatingLongOne / floatingLongTwoChecks if this FloatingLong is equal to the given FloatingLong.
floatingLongOne == floatingLongTwoCompares this FloatingLong to the given FloatingLong.