Home Migration Guide Getting Started With Scripts Commands Examples
Generic JSON Recipes
About Mekanism

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.

script.zs
import mods.mekanism.api.FloatingLong;

Static Methods

Creates a FloatingLong representing the given double.

Return Type: FloatingLong

script.zs
FloatingLong.create(value as double) as FloatingLong
ParameterTypeDescription
Parameter
value
Type
double
Description
Double to convert

Creates a FloatingLong representing the given long.

Return Type: FloatingLong

script.zs
FloatingLong.create(value as long) as FloatingLong
ParameterTypeDescription
Parameter
value
Type
long
Description
Long to convert

Creates a FloatingLong representing the given string representation.

Return Type: FloatingLong

script.zs
FloatingLong.create(value as string) as FloatingLong
ParameterTypeDescription
Parameter
value
Type
string
Description
String to parse

Creates a FloatingLong representing the given unsigned long.

Return Type: FloatingLong

script.zs
FloatingLong.createFromUnsigned(value as long) as FloatingLong
ParameterTypeDescription
Parameter
value
Type
long
Description
Unsigned long to convert

Casters

Result typeIs 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

script.zs
FloatingLong.add(toAdd as FloatingLong) as FloatingLong
ParameterTypeDescription
Parameter
toAdd
Type
FloatingLong
Description
The FloatingLong to add.

Converts this floating long to a string

Return Type: string

script.zs
// 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

script.zs
FloatingLong.compareTo(toCompare as FloatingLong) as int
ParameterTypeDescription
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

script.zs
FloatingLong.divide(toDivide as FloatingLong) as FloatingLong
ParameterTypeDescription
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

script.zs
FloatingLong.isEqual(toCompare as FloatingLong) as boolean
ParameterTypeDescription
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

script.zs
FloatingLong.multiply(toMultiply as FloatingLong) as FloatingLong
ParameterTypeDescription
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

script.zs
FloatingLong.subtract(toSubtract as FloatingLong) as FloatingLong
ParameterTypeDescription
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.

script.zs
floatingLongOne - floatingLongTwo

Adds the given FloatingLong to this FloatingLong and returns the result in a new object.

script.zs
floatingLongOne + floatingLongTwo

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.

script.zs
floatingLongOne * floatingLongTwo

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.

script.zs
floatingLongOne / floatingLongTwo

Checks if this FloatingLong is equal to the given FloatingLong.

script.zs
floatingLongOne == floatingLongTwo

Compares this FloatingLong to the given FloatingLong.