Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

math-os

layeeque-md22MIT0.1.0

Mathematical Operation Services

gcd, lcm, hcf, log, natural log, sqrt, square root, Perfect square

readme

Mathematical Operation Services

Description

mathos is a simple Node.js library that provides mathematical operations such as calculating the Greatest Common Divisor (GCD) and Least Common Multiple (LCM).

Installation

To install the library, run:

npm install math-os

Usage

const { gcd, lcm } = require("math-os");

console.log(gcd(12, 18)); // 6
console.log(lcm(12, 18)); // 36
console.log(log(8)); // 2.0794415415
console.log(sqrt(9)); // 3
console.log(sqrt(10)); // 3.1622776601683795
console.log(isPerfectSquare(9)); // true
console.log(isPerfectSquare(10)); // false

License

This project is licensed under the MIT License - see the LICENSE file for details.