index.js
zzmq.dev@gmail.com/mathkit / index.js
@ 9271926f
Download
Ladder Summary
- file This module acts as the central public interface for the mathkit library, defining a `sum` utility that adds any number of numeric arguments and re-exporting all core mathematical functions from the `src` directory, now including the newly added `lcm` function for least common multiples.
export function sum(...numbers) {
return numbers.reduce((total, n) => total + n, 0);
}
export { isOdd } from "./src/isOdd.js";
export { isEven } from "./src/isEven.js";
export { min } from "./src/min.js";
export { isPrime } from "./src/isPrime.js";
export { factorial } from "./src/factorial.js";
export { clamp } from "./src/clamp.js";
export { mean } from "./src/mean.js";
export { median } from "./src/median.js";
export { isPerfectSquare } from "./src/isPerfectSquare.js";
export { gcd } from "./src/gcd.js";
export { lcm } from "./src/lcm.js";