Skip to main content

Built and signed on GitHub Actions

A package provides implementation of complex numbers and mathematical functions for complex numbers.

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
4 months ago (1.1.1)
function cmplx
cmplx(
real: number,
imag?: number,
): complex

Creates a new complex number.

Examples

Example 1

import { cmplx } from "@babia/complex";

cmplx(0);      // 0 + 0i
cmplx(2.2, 2); // 2.2 + 2i

Parameters

real: number

The real part

optional
imag: number

The imaginary part

Return Type

Add Package

deno add jsr:@babia/complex

Import symbol

import { cmplx } from "@babia/complex";

---- OR ----

Import directly with a jsr specifier

import { cmplx } from "jsr:@babia/complex";

Add Package

npx jsr add @babia/complex

Import symbol

import { cmplx } from "@babia/complex";

Add Package

yarn dlx jsr add @babia/complex

Import symbol

import { cmplx } from "@babia/complex";

Add Package

pnpm dlx jsr add @babia/complex

Import symbol

import { cmplx } from "@babia/complex";

Add Package

bunx jsr add @babia/complex

Import symbol

import { cmplx } from "@babia/complex";