import type { array, matrix } from "../types"; /** * Computes the square root of a number, array, or matrix. * * Computes the square root of each element in a number, array, or matrix. Returns NaN for negative values. * * @param x The input value(s) * @returns The square root of the input value(s) * @throws If no arguments are provided * * @example Square root of a single number * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(sqrt(6), 2.449489742783178); * * ``` * * @example Square root of an array of numbers * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(sqrt([5, 6, 3]), [2.23606797749979, 2.449489742783178, 1.7320508075688772]); * * ``` * * @example Square root of a matrix of numbers * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(sqrt([[5, 6, 5], [7, 8, 2]]), [[2.23606797749979, 2.449489742783178, 2.23606797749979], [2.6457513110645907, 2.8284271247461903, 1.4142135623730951]]); * * ``` */ export default function sqrt(x: number): number; /** * Computes the square root of a number, array, or matrix. * * Computes the square root of each element in a number, array, or matrix. Returns NaN for negative values. * * @param x The input value(s) * @returns The square root of the input value(s) * @throws If no arguments are provided * * @example Square root of a single number * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(sqrt(6), 2.449489742783178); * * ``` * * @example Square root of an array of numbers * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(sqrt([5, 6, 3]), [2.23606797749979, 2.449489742783178, 1.7320508075688772]); * * ``` * * @example Square root of a matrix of numbers * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(sqrt([[5, 6, 5], [7, 8, 2]]), [[2.23606797749979, 2.449489742783178, 2.23606797749979], [2.6457513110645907, 2.8284271247461903, 1.4142135623730951]]); * * ``` */ export default function sqrt(x: array): array; /** * Computes the square root of a number, array, or matrix. * * Computes the square root of each element in a number, array, or matrix. Returns NaN for negative values. * * @param x The input value(s) * @returns The square root of the input value(s) * @throws If no arguments are provided * * @example Square root of a single number * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(sqrt(6), 2.449489742783178); * * ``` * * @example Square root of an array of numbers * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(sqrt([5, 6, 3]), [2.23606797749979, 2.449489742783178, 1.7320508075688772]); * * ``` * * @example Square root of a matrix of numbers * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(sqrt([[5, 6, 5], [7, 8, 2]]), [[2.23606797749979, 2.449489742783178, 2.23606797749979], [2.6457513110645907, 2.8284271247461903, 1.4142135623730951]]); * * ``` */ export default function sqrt(x: matrix): matrix; /** * Computes the square root of a number, array, or matrix. * * Computes the square root of each element in a number, array, or matrix. Returns NaN for negative values. * * @param x The input value(s) * @returns The square root of the input value(s) * @throws If no arguments are provided * * @example Square root of a single number * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(sqrt(6), 2.449489742783178); * * ``` * * @example Square root of an array of numbers * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(sqrt([5, 6, 3]), [2.23606797749979, 2.449489742783178, 1.7320508075688772]); * * ``` * * @example Square root of a matrix of numbers * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(sqrt([[5, 6, 5], [7, 8, 2]]), [[2.23606797749979, 2.449489742783178, 2.23606797749979], [2.6457513110645907, 2.8284271247461903, 1.4142135623730951]]); * * ``` */ export default function sqrt(x: number | array): number | array; /** * Computes the square root of a number, array, or matrix. * * Computes the square root of each element in a number, array, or matrix. Returns NaN for negative values. * * @param x The input value(s) * @returns The square root of the input value(s) * @throws If no arguments are provided * * @example Square root of a single number * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(sqrt(6), 2.449489742783178); * * ``` * * @example Square root of an array of numbers * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(sqrt([5, 6, 3]), [2.23606797749979, 2.449489742783178, 1.7320508075688772]); * * ``` * * @example Square root of a matrix of numbers * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(sqrt([[5, 6, 5], [7, 8, 2]]), [[2.23606797749979, 2.449489742783178, 2.23606797749979], [2.6457513110645907, 2.8284271247461903, 1.4142135623730951]]); * * ``` */ export default function sqrt(x: number | matrix): number | matrix; /** * Computes the square root of a number, array, or matrix. * * Computes the square root of each element in a number, array, or matrix. Returns NaN for negative values. * * @param x The input value(s) * @returns The square root of the input value(s) * @throws If no arguments are provided * * @example Square root of a single number * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(sqrt(6), 2.449489742783178); * * ``` * * @example Square root of an array of numbers * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(sqrt([5, 6, 3]), [2.23606797749979, 2.449489742783178, 1.7320508075688772]); * * ``` * * @example Square root of a matrix of numbers * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(sqrt([[5, 6, 5], [7, 8, 2]]), [[2.23606797749979, 2.449489742783178, 2.23606797749979], [2.6457513110645907, 2.8284271247461903, 1.4142135623730951]]); * * ``` */ export default function sqrt(x: array | matrix): array | matrix; //# sourceMappingURL=sqrt.d.ts.map