SerikaNum
    Preparing search index...

    Interface OnoeNumConstructor

    Static version of OnoeNum. This is only separated because roblox-ts requires it. You can simply ignore the naming and treat this interface as OnoeNum.

    interface OnoeNumConstructor {
        new OnoeNumConstructor(val: Number): OnoeNum;
        abs: (number: Number) => OnoeNum;
        ceil: (number: Number) => OnoeNum;
        floor: (number: Number) => OnoeNum;
        fromSerika: (mantissa: number, exponent: number) => OnoeNum;
        fromSingle: (single: number) => OnoeNum;
        fromString: (str: string) => OnoeNum;
        fromSuffix: (str: string) => OnoeNum;
        log: (number: Number, base: number) => undefined | OnoeNum;
        log10: (number: Number) => undefined | OnoeNum;
        max: (...numbers: Number[]) => OnoeNum;
        min: (...numbers: Number[]) => OnoeNum;
        minmax: (a: Number, b: Number) => LuaTuple<[OnoeNum, OnoeNum]>;
        random: (min: Number, max: Number) => OnoeNum;
        reciprocal: (number: Number) => OnoeNum;
        revert: (number: BaseOnoeNum) => number;
        root: (number: Number, root: number) => OnoeNum;
        round: (number: Number) => OnoeNum;
        toScientific: (number: Number) => string;
        toSingle: (number: Number) => number;
        toString: (number: Number, mode?: "suffix" | "scientific") => string;
        toSuffix: (number: Number) => string;
        unary: (number: Number) => OnoeNum;
    }
    Index

    Constructors

    • Create a new OnoeNum object from a primitive number.

      Parameters

      • val: Number

        Primitive number or a table containing mantissa and exponent entries

      Returns OnoeNum

    Properties

    abs: (number: Number) => OnoeNum

    Get the absolute value of the OnoeNum.

    Type Declaration

    ceil: (number: Number) => OnoeNum

    Rounds up the OnoeNum to the nearest integer. This operation is unsafe for numbers beyond 2^1024.

    Type Declaration

    floor: (number: Number) => OnoeNum

    Rounds down the OnoeNum to the nearest integer. This operation is unsafe for numbers beyond 2^1024.

    Type Declaration

    fromSerika: (mantissa: number, exponent: number) => OnoeNum

    Create a new OnoeNum object from a mantissa and exponent. This simply wraps the two numbers into a table and provides it the OnoeNum metatable. This could be useful for quickly creating large numbers exceeding 10^308 without having to do num1 * 10 ^ num2.

    Type Declaration

      • (mantissa: number, exponent: number): OnoeNum
      • Parameters

        • mantissa: number

          Mantissa of the SerikaNum

        • exponent: number

          Exponent of the SerikaNum

        Returns OnoeNum

        Resulting OnoeNum object

    const number = OnoeNum.fromSerika(5.23, 2359) // 5.23e2359
    
    fromSingle: (single: number) => OnoeNum

    Converts the single primitive number back into an OnoeNum object. This OnoeNum object is usually much more imprecise than it previous was before conversion into a single primitive number. Use this method to display numbers stored in leaderboard datastores.

    Type Declaration

      • (single: number): OnoeNum
      • Parameters

        • single: number

          Single primitive number

        Returns OnoeNum

        Resulting OnoeNum object

    fromString: (str: string) => OnoeNum

    Converts a formatted string into an OnoeNum object.

    Type Declaration

      • (str: string): OnoeNum
      • Parameters

        • str: string

          String to parse

        Returns OnoeNum

        Resulting OnoeNum object

    fromString("5.5UCe") // returns OnoeNum: 5.5UCe
    fromString("5.5e125") // returns OnoeNum: 5.5e125
    fromSuffix: (str: string) => OnoeNum

    Converts a formatted string into an OnoeNum object.

    Type Declaration

      • (str: string): OnoeNum
      • Parameters

        • str: string

          String to parse

        Returns OnoeNum

        Resulting OnoeNum object

    fromSuffix("5.5UCe") // returns OnoeNum: 5.5UCe
    
    log: (number: Number, base: number) => undefined | OnoeNum

    Get the logarithm of the OnoeNum object with the specified primitive number base.

    Type Declaration

      • (number: Number, base: number): undefined | OnoeNum
      • Parameters

        • number: Number

          OnoeNum object

        • base: number

          Base of the logarithm as a primitive number

        Returns undefined | OnoeNum

        Resulting OnoeNum object. Note that if the specified number is negative, this will return nil.

    log10: (number: Number) => undefined | OnoeNum

    Get the logarithm of the OnoeNum object with a base of 10.

    Type Declaration

    max: (...numbers: Number[]) => OnoeNum

    Returns the maximum value of all OnoeNum objects passed.

    Type Declaration

    min: (...numbers: Number[]) => OnoeNum

    Returns the minimum value of all OnoeNum objects passed.

    Type Declaration

    minmax: (a: Number, b: Number) => LuaTuple<[OnoeNum, OnoeNum]>

    Returns the minimum and maximum values of the two OnoeNum objects passed.

    Type Declaration

    random: (min: Number, max: Number) => OnoeNum

    Generates a random OnoeNum object between the specified minimum and maximum values, inclusive. The distribution is uniform across the range.

    Type Declaration

    reciprocal: (number: Number) => OnoeNum

    Calculates the reciprocal of the OnoeNum object (1/x).

    Type Declaration

    revert: (number: BaseOnoeNum) => number

    Reverts the OnoeNum back to a primitive number. For numbers beyond 2^1024, this will return math.huge.

    Type Declaration

      • (number: BaseOnoeNum): number
      • Parameters

        Returns number

        Reverted primitive number

    root: (number: Number, root: number) => OnoeNum

    Calculates the nth root of the OnoeNum object.

    Type Declaration

      • (number: Number, root: number): OnoeNum
      • Parameters

        • number: Number

          OnoeNum object

        • root: number

          Root to calculate (e.g., 2 for square root, 3 for cube root)

        Returns OnoeNum

        Resulting OnoeNum object

    round: (number: Number) => OnoeNum

    Rounds the OnoeNum to the nearest integer. This operation is unsafe for numbers beyond 2^1024.

    Type Declaration

    toScientific: (number: Number) => string

    Converts the OnoeNum object into a string in scientific notation format.

    Type Declaration

      • (number: Number): string
      • Parameters

        Returns string

        Resulting string

    toSingle: (number: Number) => number

    Converts the OnoeNum object into a single primitive number that represents the magnitude of the number. This method should only be used for leaderboards and other things that do not require the specific number itself as the resulting single numbers are highly imprecise.

    Type Declaration

      • (number: Number): number
      • Parameters

        Returns number

        Resulting single number

    toString: (number: Number, mode?: "suffix" | "scientific") => string

    Converts the OnoeNum object into a string with the specified mode. If suffix is used, this method is equivalent to toSuffix. If scientific is used, this method is equivalent to toScientific.

    Type Declaration

      • (number: Number, mode?: "suffix" | "scientific"): string
      • Parameters

        • number: Number

          OnoeNum object

        • Optionalmode: "suffix" | "scientific"

          Mode of conversion to string

        Returns string

        Resulting string

    toSuffix: (number: Number) => string

    Converts the OnoeNum into a string with a number and suffix. Use the Suffixer.changeSuffixes method to edit the suffixes. If a suffix for the specified OnoeNum tuple is not found, scientific notation is used.

    Type Declaration

      • (number: Number): string
      • Parameters

        Returns string

        Resulting string

    unary: (number: Number) => OnoeNum

    Flips the sign of the OnoeNum object. Equivalent to multiplying by -1.

    Type Declaration