function exp
exp(x: number): number

Computes the exponential value.

Computes the exponential value for each element in a number, array, or matrix.

Examples

Exponential of a single number

import { assertEquals } from "jsr:@std/assert";

assertEquals(exp(6), 403.4287934927351);

Exponential of an array of numbers

import { assertEquals } from "jsr:@std/assert";

assertEquals(exp([5, 6, 3]), [148.4131591025766, 403.4287934927351, 20.085536923187668]);

Exponential of a matrix of numbers

import { assertEquals } from "jsr:@std/assert";

assertEquals(exp([[5, 6, 5], [7, 8, -1]]), [
  [148.4131591025766, 403.4287934927351, 148.4131591025766],
  [1096.6331584284585, 2980.9579870417282, 0.36787944117144233]
]);

Parameters

x: number

The input value(s)

Return Type

number

The exponential of the input value(s)

Throws

If no arguments are provided

exp(x: array): array

Computes the exponential value.

Computes the exponential value for each element in a number, array, or matrix.

Examples

Exponential of a single number

import { assertEquals } from "jsr:@std/assert";

assertEquals(exp(6), 403.4287934927351);

Exponential of an array of numbers

import { assertEquals } from "jsr:@std/assert";

assertEquals(exp([5, 6, 3]), [148.4131591025766, 403.4287934927351, 20.085536923187668]);

Exponential of a matrix of numbers

import { assertEquals } from "jsr:@std/assert";

assertEquals(exp([[5, 6, 5], [7, 8, -1]]), [
  [148.4131591025766, 403.4287934927351, 148.4131591025766],
  [1096.6331584284585, 2980.9579870417282, 0.36787944117144233]
]);

Parameters

The input value(s)

Return Type

The exponential of the input value(s)

Throws

If no arguments are provided

exp(x: matrix): matrix

Computes the exponential value.

Computes the exponential value for each element in a number, array, or matrix.

Examples

Exponential of a single number

import { assertEquals } from "jsr:@std/assert";

assertEquals(exp(6), 403.4287934927351);

Exponential of an array of numbers

import { assertEquals } from "jsr:@std/assert";

assertEquals(exp([5, 6, 3]), [148.4131591025766, 403.4287934927351, 20.085536923187668]);

Exponential of a matrix of numbers

import { assertEquals } from "jsr:@std/assert";

assertEquals(exp([[5, 6, 5], [7, 8, -1]]), [
  [148.4131591025766, 403.4287934927351, 148.4131591025766],
  [1096.6331584284585, 2980.9579870417282, 0.36787944117144233]
]);

Parameters

The input value(s)

Return Type

The exponential of the input value(s)

Throws

If no arguments are provided