UNPKG

tough-rational

Version:

Rational class using BigInt with fallback to bignumber.js

6 lines (3 loc) 171 B
'use strict'; const fractionalComponent = require('./fractional-component'); module.exports = (n) => fractionalComponent(n).eq(0) ? n : n.dividedToIntegerBy(1).plus(1);