Staquia API
    Preparing search index...

    Interface IAlgorithms

    Internal: the arithmetic of the system numbers, used to create positions.

    interface IAlgorithms {
        after(value: IDigits, trim: boolean): IDigits;
        before(value: IDigits, trim: boolean): IDigits;
        between(before: IDigits, after: IDigits, round: boolean): IDigits;
        clean(value: IDigits, before: IDigits, after: IDigits): IDigits;
        compactNumbers(
            number1: IDigits,
            number2: IDigits,
            repeated: IDigits,
            mode: HalfMode,
        ): void;
        diverge(value1: IDigits, value2: IDigits): IDigits;
        half(beforeCodes: IDigits, afterCodes: IDigits, round: boolean): IDigits;
        resolveOverflow(number: IDigits): void;
        substract(left: IDigits, right: IDigits): ISignedDigits;
    }

    Hierarchy (View Summary)

    Index

    Methods

    • Gets the mid position for any number with the equation q = (nf + n0) / 2, where:

      • n0 represents the start string converted from the nth base to the 10th base
      • n1 represents the end string converted from the nth base to the 10th base

      Parameters

      • before: IDigits

        In the evaluation of two strings n1 < n2 must be n1

      • after: IDigits

        In the evaluation of two strings n1 < n2 must be n2

      • round: boolean

        Rounds the result to the nearest upper integer if set to true

      Returns IDigits

      The value q - ( q mod 2 ) When q mod 2 is different from 0 then the mid character from the set of the nth base, should be placed at the end of the output.

    • Ignores the zero values from the left until a number is found, then pass any repeated values to the repeated number and finally stores the different values as code

      Parameters

      • number1: IDigits

        The first Number generated

      • number2: IDigits

        The second Number generated

      • repeated: IDigits

        The recovered repeated values

      • mode: HalfMode

        How the shorter number is padded with zeroes, see HalfMode Both of the numbers will contain a Number.LowerBound value of -1 with a value of 0.

      Returns void

    • This system function will equalize the length of value1 and value2 adding zeroes to the right of the shorter number if needed, then will find the point where CharacterBefore <> CharacterAfter. Upon the room between these:

      • If the room > 1 will only find the value between them
      • If room <= 1 will use and optimized version of the Between function

      Parameters

      • value1: IDigits

        Must be any value such that value1 &lt; value2 or value2 &lt; value1

      • value2: IDigits

        Must be any value such that value1 &lt; value2 or value2 &lt; value1

      Returns IDigits

      The string that represents the diverged value

    • Evaluates two values to check which one goes before, gets the repeated values and after and then transforms them to code.

      Parameters

      • beforeCodes: IDigits

        The before codes

      • afterCodes: IDigits

        The after codes

      • round: boolean

        Defines if the value should be rounded upwards

      Returns IDigits