my_super_puper_unique_math_library
v1.0.0
Published
A simple math library for common calculations
Downloads
3
Readme
My Math Library
This is a simple library that provides basic mathematical operations.
Installation
You can install this package using npm:
npm install my-math-library
Usage
Here are examples of how to use the library:
const math = require('my-math-library');
// Addition
console.log(math.add(2, 3)); // 5
// Subtraction
console.log(math.subtract(5, 3)); // 2
// Multiplication
console.log(math.multiply(4, 5)); // 20
// Division
console.log(math.divide(10, 2)); // 5
// Solving quadratic equations
console.log(math.solveQuadratic(1, -3, 2)); // [2, 1]
API
add(a, b) - Returns the sum of two numbers.
subtract(a, b) - Returns the difference between two numbers.
multiply(a, b) - Returns the product of two numbers.
divide(a, b) - Returns the quotient of two numbers. Throws an error if b is 0.
solveQuadratic(a, b, c) - Solves a quadratic equation ax^2 + bx + c = 0. Returns an array of solutions or null if no real solutions exist.