UNPKG

theorem.js

Version:

A Math library for computation in JavaScript

5 lines (4 loc) 120 B
toFraction(x, p=15) { const BN = BigNumber.clone({ DECIMAL_PLACES: 20 }) return new BN(x.toFixed(15)).toFraction(p) }