MCPcopy
hub / github.com/TheAlgorithms/JavaScript / floorDiv

Function floorDiv

Conversions/ArbitraryBase.js:7–12  ·  view source on GitHub ↗
(dividend, divisor)

Source from the content-addressed store, hash-verified

5 * @returns {[result: number, remainder: number]}
6 */
7const floorDiv = (dividend, divisor) => {
8 const remainder = dividend % divisor
9 const result = Math.floor(dividend / divisor)
10
11 return [result, remainder]
12}
13
14/**
15 * Converts a string from one base to other. Loses accuracy above the value of `Number.MAX_SAFE_INTEGER`.

Callers 1

convertArbitraryBaseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected