Skip to main content

@coven/math@0.1.0
Built and signed on GitHub Actions

💀 Math witchcraft.

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
2 days ago (0.1.0)
Coven Engineering Math logo

JSR JSR Score

💀 Math witchcraft.

Using this library, adding 0.2 + 0.1 will result in 0.3, and that might look like nothing to the untrained eye, but it's not what JavaScript usually does.

The way we achieve this is by using a tuple we called Precise which contains a representation of the base and exponent of a number using bigint. We then do all math operations over base and exponent in those tuples and turn them back to number when we are done.

As all Coven Engineering libraries, it has 100% test coverage and it's built in top of modern tech compatible with all JavaScript runtimes.

Example

import { calculate } from "@coven/math";

calculate(0.1).add(0.2); // 0.3 🤯
Built and signed on
GitHub Actions
View transparency log

Add Package

deno add jsr:@coven/math

Import symbol

import * as mod from "@coven/math";

---- OR ----

Import directly with a jsr specifier

import * as mod from "jsr:@coven/math";

Add Package

npx jsr add @coven/math

Import symbol

import * as mod from "@coven/math";

Add Package

yarn dlx jsr add @coven/math

Import symbol

import * as mod from "@coven/math";

Add Package

pnpm dlx jsr add @coven/math

Import symbol

import * as mod from "@coven/math";

Add Package

bunx jsr add @coven/math

Import symbol

import * as mod from "@coven/math";