UNPKG

xen-dev-utils

Version:

Utility functions used by the Scale Workshop ecosystem

13 lines (12 loc) 805 B
import { Fraction, FractionValue } from './fraction'; import { Monzo } from './monzo'; export declare function toMonzoLegacy(n: FractionValue | bigint): Monzo; export declare function primeLimitLegacy(n: FractionValue | bigint, asOrdinal?: boolean, maxLimit?: number): number; /** * Extract the exponents of the prime factors of a rational number. * @param n Rational number to convert to a monzo. * @param numberOfComponents Number of components in the result. * @returns The monzo representing `n` and a multiplicative residue that cannot be represented in the given limit. */ export declare function toMonzoAndResidualLegacy(n: bigint, numberOfComponents: number): [Monzo, bigint]; export declare function toMonzoAndResidualLegacy(n: FractionValue, numberOfComponents: number): [Monzo, Fraction];