You may set a non-zero tolerance to account for floating point errors when dealing with non-integers.
import * as N from "flurp/number";const divisibleByThree = N.isDivisibleBy(3);divisibleByThree(6); // truedivisibleByThree(5); // falseconst almostEven = N.isDivisibleBy(2, 1e-12);almostEven(4 - 1e-13); // true
Remarks
You may set a non-zero tolerance to account for floating point errors when dealing with non-integers.
Example