Skip to content
This repository has been archived by the owner on Jul 19, 2024. It is now read-only.

BLU-Shack/blu-math

Repository files navigation

BLU-Math

Math supplements and stuff I guess.

Fixes some problems that happen when performing math stuff?

Usage

Initialization:

const BluMath = require('blu-math');

Adding numbers:

BluMath.add(0.1, 0.2) // 0.3
(0.1 + 0.2) // 0.30000000000000004

Subtracting Numbers:

// The first number is the base. That is the number that will be subtracted.
// The proceeding numbers will subtract from the base.
// This basically means 0.3
BluMath.subtract(0.3, 0.1, 0.1) // 0.1
(0.3 - 0.1 - 0.1) // 0.09999999999999998

Multiplying Numbers:

BluMath.multiply(0.2, 0.1) // 0.02
(0.2 * 0.1) // 0.020000000000000004

Dividing Numbers:

// The first number is the base. That will be the number that will be divided by the proceeding numbers.
// Basically 0.3 / 0.1 / 0.1
BluMath.divide(0.3, 0.1, 0.1) // 30
(0.3 / 0.1 / 0.1) // 29.999999999999993

Releases

No releases published

Packages

No packages published