divrem
v1.0.3
Published
Calculates the division result, divide count, quotient and remainder of two numbers.
Downloads
2
Readme
divrem
Calculates the division result, divide count, quotient and remainder of two numbers.
Installation
npm install --save divrem
Usage
import { divrem } from "divrem";
or
const divrem = require("divrem").divrem;
Using divrem between two divisible numbers
divrem(4, 2);
//{ count: 2, quotient: 2, rem: 0, result: 2 }
divrem(6, 4);
//{ count: 1, quotient: 1, rem: 2, result: 1.5 }
divrem(17, 11);
//{ count: 1, quotient: 1, rem: 6, result: 1.5454545454545454 }
divrem(2.3, 1.4);
//{ count: 1, quotient: 1, rem: 0.8999999999999999, result: 1.6428571428571428 }
divrem(-7,4);
//{ count: 1, quotient: -1, rem: -3, result: -1.75 }