New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@abw/badger-maths

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@abw/badger-maths

This library implements some basic mathematical functions that work around the imprecision in the IEEE 754 standard which Javascript uses for floating point numbers.

latest
Source
npmnpm
Version
0.0.1
Version published
Maintainers
0
Created
Source

Badger Maths

This library implements some basic mathematical functions that work around the imprecision in the IEEE 754 standard which Javascript uses for floating point numbers.

They were originally written using a fixed floating point algorithm based on the code in Sinful.js.

They are now implemented as Typescript wrappers around big.js.

Installation

Install badger-maths using your favourite package manager.

npm

npm add @abw/badger-maths

pnpm

pnpm add @abw/badger-maths

yarn

yarn add @abw/badger-maths

Quick Start

Import the add, subtract, multiply and/or divide functions from @abw/badger-maths.

import { add, subtract, multiply, divide } from '@abw/badger-maths'

Then use them to add, subtract, multiple or divide two or more numbers.

add(1.1, 6.6, 0.1);         // 1.1 + 6.6 + 0.1 => 7.8
subtract(7.8, 0.1, 2.4);    // 7.8 - 0.1 - 2.4 => 5.3
multiply(3.0, 2.2, 2.0);    // 3.0 * 2.2 * 2.0 => 13.2
divide(13.2, 2.0, 1.1);     // 13.2 / 2.0 / 1.1 => 6

Documentation

Visit the website for detailed documentation.

Author

Andy Wardley abw@wardley.org

FAQs

Package last updated on 26 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts