{"version":3,"file":"_isMultipleOf.mjs","names":[],"sources":["../../src/internal/_isMultipleOf.ts"],"sourcesContent":["import { _decimalDecompose, _decimalDivide } from \"./_decimal\";\n\n/**\n * Test whether a number is a multiple of a divisor, reading both as decimals.\n *\n * `0.3` is a multiple of `0.1`. A non-finite number or a divisor that is not\n * positive gives false.\n *\n * @evidence contracts/common.md#principled-implementation Both numbers are read as the decimals they print as and the ratio of the dividend to the divisor is tested exactly with big integers, so `0.3` is a multiple of `0.1`; a non-finite value or a non-positive divisor is false.\n * @evidence contracts/common.md#clear-and-simple-design One predicate over the shared decimal helpers, which the random multiple generator also uses.\n * @evidence contracts/common.md#prohibited-implementation-shortcuts The decimal reading is the tag's documented meaning.\n * @evidence contracts/common.md#meaningful-documentation A comment states the decimal reading and the false cases.\n */\nexport const _isMultipleOf = (value: number, multipleOf: number): boolean => {\n  const divisor = _decimalDecompose(multipleOf);\n  if (divisor === null || divisor.coefficient <= BigInt(0)) return false;\n  const ratio = _decimalDivide(value, divisor);\n  return ratio !== null && ratio.numerator % ratio.denominator === BigInt(0);\n};\n"],"mappings":";;;;;;;;;;;;;AAaA,MAAa,iBAAiB,OAAe,eAAgC;CAC3E,MAAM,UAAU,kBAAkB,UAAU;CAC5C,IAAI,YAAY,QAAQ,QAAQ,eAAe,OAAO,CAAC,GAAG,OAAO;CACjE,MAAM,QAAQ,eAAe,OAAO,OAAO;CAC3C,OAAO,UAAU,QAAQ,MAAM,YAAY,MAAM,gBAAgB,OAAO,CAAC;AAC3E"}