def Decimal.read.coef

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

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

396# The coefficient; ds holds only digits, so read cannot fail.
397def Decimal.read.coef(neg: Bool, ds: String) -> Big.BigInt:
398  match neg:
399    case True{}:
400      Big.BigInt.neg(Decimal.read.abs(Big.BigInt.read(String.reverse(ds))))
401    case False{}:
402      Decimal.read.abs(Big.BigInt.read(String.reverse(ds)))

Uses (7)

Used by (1)