def Decimal.from_fraction

bend-kit-bignum@0.1.0.0 · decimal.bend:147

import bend-kit-bignum@0.1.0.0/decimal.bend as Decimal
import Base
import bend-kit-bignum@0.1.0.0/bigint.bend as Big

147# n / d at the smallest exact scale, or None when d is zero or the decimal
148# expansion does not terminate (d has a prime factor other than 2 and 5).
149def Decimal.from_fraction(n: Big.BigInt, +d: Big.BigInt) -> Maybe<&2, Decimal>:
150  Decimal.frac.if(Big.BigInt.is_zero(d), n, d)

Uses (5)

Used by (2)