Chalkboard - v3.0.1
    Preparing search index...

    Function toTypedArray

    • Converts a complex number to a typed array.

      Parameters

      • comp: ChalkboardComplex

        The complex number

      • Optionaltype: "int8" | "int16" | "int32" | "float32" | "float64" | "bigint64" = "float32"

        The type of the typed array, which can be "int8", "int16", "int32", "float32", "float64", or "bigint64" (optional, defaults to "float32")

      Returns
          | Float32Array<ArrayBufferLike>
          | Float64Array<ArrayBufferLike>
          | Int8Array<ArrayBufferLike>
          | Int16Array<ArrayBufferLike>
          | Int32Array<ArrayBufferLike>
          | BigInt64Array<ArrayBufferLike>

      // Returns a Float32Array [3, 4]
      const z = Chalkboard.comp.init(3, 4);
      const zf32 = Chalkboard.comp.toTypedArray(z);