import type { array, matrix } from "../types"; /** * Right array division X. / Y. * * Divides each element of X by the corresponding element of Y. Inputs X and Y must have the same size. * * @param x The dividend * @param y The divisor * @returns The result of the division * @throws If insufficient arguments are provided or if the input sizes do not match * * @example Divide two numbers * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(rdivide(5, 6), 0.8333333333333334); * * ``` * * @example Divide a matrix by a scalar * ```ts * import { assertEquals } from "jsr:@std/assert"; * * const a = [[5, 6, 5], [7, 8, -1]]; * assertEquals(rdivide(a, 3), [[1.6666666666666667, 2, 1.6666666666666667], * [2.3333333333333335, 2.6666666666666665, -0.3333333333333333]]); * * ``` * * @example Divide a scalar by a vector * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(rdivide(3, [-1, -2, -3]), [-3, -1.5, -1]); * * ``` * * @example Element-wise division of two vectors * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(rdivide([5, 6, 7], [-1, -2, -3]), [-5, -3, -2.3333333333333335]); * * ``` * * @example Element-wise division of two matrices * ```ts * import { assertEquals } from "jsr:@std/assert"; * * const e = [[9, 5], [6, 1]]; * const f = [[3, 2], [5, 2]]; * assertEquals(rdivide(e, f), [[3, 2.5], [1.2, 0.5]]); * * ``` * * @example Divide a matrix by a scalar * ```ts * import { assertEquals } from "jsr:@std/assert"; * * const e = [[9, 5], [6, 1]]; * * assertEquals(rdivide(e, 3), [[3, 1.6666666666666667], [2, 0.3333333333333333]]); * ``` */ export default function rdivide(x: number, y: number): number; /** * Right array division X. / Y. * * Divides each element of X by the corresponding element of Y. Inputs X and Y must have the same size. * * @param x The dividend * @param y The divisor * @returns The result of the division * @throws If insufficient arguments are provided or if the input sizes do not match * * @example Divide two numbers * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(rdivide(5, 6), 0.8333333333333334); * * ``` * * @example Divide a matrix by a scalar * ```ts * import { assertEquals } from "jsr:@std/assert"; * * const a = [[5, 6, 5], [7, 8, -1]]; * assertEquals(rdivide(a, 3), [[1.6666666666666667, 2, 1.6666666666666667], * [2.3333333333333335, 2.6666666666666665, -0.3333333333333333]]); * * ``` * * @example Divide a scalar by a vector * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(rdivide(3, [-1, -2, -3]), [-3, -1.5, -1]); * * ``` * * @example Element-wise division of two vectors * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(rdivide([5, 6, 7], [-1, -2, -3]), [-5, -3, -2.3333333333333335]); * * ``` * * @example Element-wise division of two matrices * ```ts * import { assertEquals } from "jsr:@std/assert"; * * const e = [[9, 5], [6, 1]]; * const f = [[3, 2], [5, 2]]; * assertEquals(rdivide(e, f), [[3, 2.5], [1.2, 0.5]]); * * ``` * * @example Divide a matrix by a scalar * ```ts * import { assertEquals } from "jsr:@std/assert"; * * const e = [[9, 5], [6, 1]]; * * assertEquals(rdivide(e, 3), [[3, 1.6666666666666667], [2, 0.3333333333333333]]); * ``` */ export default function rdivide(x: number, y: array): array; /** * Right array division X. / Y. * * Divides each element of X by the corresponding element of Y. Inputs X and Y must have the same size. * * @param x The dividend * @param y The divisor * @returns The result of the division * @throws If insufficient arguments are provided or if the input sizes do not match * * @example Divide two numbers * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(rdivide(5, 6), 0.8333333333333334); * * ``` * * @example Divide a matrix by a scalar * ```ts * import { assertEquals } from "jsr:@std/assert"; * * const a = [[5, 6, 5], [7, 8, -1]]; * assertEquals(rdivide(a, 3), [[1.6666666666666667, 2, 1.6666666666666667], * [2.3333333333333335, 2.6666666666666665, -0.3333333333333333]]); * * ``` * * @example Divide a scalar by a vector * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(rdivide(3, [-1, -2, -3]), [-3, -1.5, -1]); * * ``` * * @example Element-wise division of two vectors * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(rdivide([5, 6, 7], [-1, -2, -3]), [-5, -3, -2.3333333333333335]); * * ``` * * @example Element-wise division of two matrices * ```ts * import { assertEquals } from "jsr:@std/assert"; * * const e = [[9, 5], [6, 1]]; * const f = [[3, 2], [5, 2]]; * assertEquals(rdivide(e, f), [[3, 2.5], [1.2, 0.5]]); * * ``` * * @example Divide a matrix by a scalar * ```ts * import { assertEquals } from "jsr:@std/assert"; * * const e = [[9, 5], [6, 1]]; * * assertEquals(rdivide(e, 3), [[3, 1.6666666666666667], [2, 0.3333333333333333]]); * ``` */ export default function rdivide(x: array, y: number): array; /** * Right array division X. / Y. * * Divides each element of X by the corresponding element of Y. Inputs X and Y must have the same size. * * @param x The dividend * @param y The divisor * @returns The result of the division * @throws If insufficient arguments are provided or if the input sizes do not match * * @example Divide two numbers * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(rdivide(5, 6), 0.8333333333333334); * * ``` * * @example Divide a matrix by a scalar * ```ts * import { assertEquals } from "jsr:@std/assert"; * * const a = [[5, 6, 5], [7, 8, -1]]; * assertEquals(rdivide(a, 3), [[1.6666666666666667, 2, 1.6666666666666667], * [2.3333333333333335, 2.6666666666666665, -0.3333333333333333]]); * * ``` * * @example Divide a scalar by a vector * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(rdivide(3, [-1, -2, -3]), [-3, -1.5, -1]); * * ``` * * @example Element-wise division of two vectors * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(rdivide([5, 6, 7], [-1, -2, -3]), [-5, -3, -2.3333333333333335]); * * ``` * * @example Element-wise division of two matrices * ```ts * import { assertEquals } from "jsr:@std/assert"; * * const e = [[9, 5], [6, 1]]; * const f = [[3, 2], [5, 2]]; * assertEquals(rdivide(e, f), [[3, 2.5], [1.2, 0.5]]); * * ``` * * @example Divide a matrix by a scalar * ```ts * import { assertEquals } from "jsr:@std/assert"; * * const e = [[9, 5], [6, 1]]; * * assertEquals(rdivide(e, 3), [[3, 1.6666666666666667], [2, 0.3333333333333333]]); * ``` */ export default function rdivide(x: array, y: array): array; /** * Right array division X. / Y. * * Divides each element of X by the corresponding element of Y. Inputs X and Y must have the same size. * * @param x The dividend * @param y The divisor * @returns The result of the division * @throws If insufficient arguments are provided or if the input sizes do not match * * @example Divide two numbers * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(rdivide(5, 6), 0.8333333333333334); * * ``` * * @example Divide a matrix by a scalar * ```ts * import { assertEquals } from "jsr:@std/assert"; * * const a = [[5, 6, 5], [7, 8, -1]]; * assertEquals(rdivide(a, 3), [[1.6666666666666667, 2, 1.6666666666666667], * [2.3333333333333335, 2.6666666666666665, -0.3333333333333333]]); * * ``` * * @example Divide a scalar by a vector * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(rdivide(3, [-1, -2, -3]), [-3, -1.5, -1]); * * ``` * * @example Element-wise division of two vectors * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(rdivide([5, 6, 7], [-1, -2, -3]), [-5, -3, -2.3333333333333335]); * * ``` * * @example Element-wise division of two matrices * ```ts * import { assertEquals } from "jsr:@std/assert"; * * const e = [[9, 5], [6, 1]]; * const f = [[3, 2], [5, 2]]; * assertEquals(rdivide(e, f), [[3, 2.5], [1.2, 0.5]]); * * ``` * * @example Divide a matrix by a scalar * ```ts * import { assertEquals } from "jsr:@std/assert"; * * const e = [[9, 5], [6, 1]]; * * assertEquals(rdivide(e, 3), [[3, 1.6666666666666667], [2, 0.3333333333333333]]); * ``` */ export default function rdivide(x: number, y: matrix): matrix; /** * Right array division X. / Y. * * Divides each element of X by the corresponding element of Y. Inputs X and Y must have the same size. * * @param x The dividend * @param y The divisor * @returns The result of the division * @throws If insufficient arguments are provided or if the input sizes do not match * * @example Divide two numbers * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(rdivide(5, 6), 0.8333333333333334); * * ``` * * @example Divide a matrix by a scalar * ```ts * import { assertEquals } from "jsr:@std/assert"; * * const a = [[5, 6, 5], [7, 8, -1]]; * assertEquals(rdivide(a, 3), [[1.6666666666666667, 2, 1.6666666666666667], * [2.3333333333333335, 2.6666666666666665, -0.3333333333333333]]); * * ``` * * @example Divide a scalar by a vector * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(rdivide(3, [-1, -2, -3]), [-3, -1.5, -1]); * * ``` * * @example Element-wise division of two vectors * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(rdivide([5, 6, 7], [-1, -2, -3]), [-5, -3, -2.3333333333333335]); * * ``` * * @example Element-wise division of two matrices * ```ts * import { assertEquals } from "jsr:@std/assert"; * * const e = [[9, 5], [6, 1]]; * const f = [[3, 2], [5, 2]]; * assertEquals(rdivide(e, f), [[3, 2.5], [1.2, 0.5]]); * * ``` * * @example Divide a matrix by a scalar * ```ts * import { assertEquals } from "jsr:@std/assert"; * * const e = [[9, 5], [6, 1]]; * * assertEquals(rdivide(e, 3), [[3, 1.6666666666666667], [2, 0.3333333333333333]]); * ``` */ export default function rdivide(x: matrix, y: number): matrix; /** * Right array division X. / Y. * * Divides each element of X by the corresponding element of Y. Inputs X and Y must have the same size. * * @param x The dividend * @param y The divisor * @returns The result of the division * @throws If insufficient arguments are provided or if the input sizes do not match * * @example Divide two numbers * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(rdivide(5, 6), 0.8333333333333334); * * ``` * * @example Divide a matrix by a scalar * ```ts * import { assertEquals } from "jsr:@std/assert"; * * const a = [[5, 6, 5], [7, 8, -1]]; * assertEquals(rdivide(a, 3), [[1.6666666666666667, 2, 1.6666666666666667], * [2.3333333333333335, 2.6666666666666665, -0.3333333333333333]]); * * ``` * * @example Divide a scalar by a vector * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(rdivide(3, [-1, -2, -3]), [-3, -1.5, -1]); * * ``` * * @example Element-wise division of two vectors * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(rdivide([5, 6, 7], [-1, -2, -3]), [-5, -3, -2.3333333333333335]); * * ``` * * @example Element-wise division of two matrices * ```ts * import { assertEquals } from "jsr:@std/assert"; * * const e = [[9, 5], [6, 1]]; * const f = [[3, 2], [5, 2]]; * assertEquals(rdivide(e, f), [[3, 2.5], [1.2, 0.5]]); * * ``` * * @example Divide a matrix by a scalar * ```ts * import { assertEquals } from "jsr:@std/assert"; * * const e = [[9, 5], [6, 1]]; * * assertEquals(rdivide(e, 3), [[3, 1.6666666666666667], [2, 0.3333333333333333]]); * ``` */ export default function rdivide(x: matrix, y: matrix): matrix; //# sourceMappingURL=rdivide.d.ts.map