Chalkboard - v3.0.4
    Preparing search index...

    Function field

    • Defines an algebraic structure known as a field.

      Type Parameters

      • T

      Parameters

      • set: ChalkboardSet<T>

        The set of the field

      • add: (a: T, b: T) => T

        The additive operation of the field

      • mul: (a: T, b: T) => T

        The multiplicative operation of the field

      • OptionaladdIdentity: T

        The additive identity element of the field

      • OptionalmulIdentity: T

        The multiplicative identity element of the field

      • OptionaladdInverter: (a: T) => T

        The function to calculate the additive inverse of an element of the field (optional if the set is Z, Q, R, C, or M)

      • OptionalmulInverter: (a: T) => T

        The function to calculate the multiplicative inverse of an element of the field (optional if the set is Z, Q, R, C, or M)

      Returns ChalkboardStructure<T>

      const Q = Chalkboard.abal.field(Chalkboard.abal.Q(), (a, b) => a + b, (a, b) => a * b);
      const valid = Chalkboard.abal.isField(Q); // Checks the field of rational numbers