BigRational.from constructor

BigRational.from(
  1. int numerator, {
  2. int? denominator,
})

Constructs a BigRational instance from the given numerator and optional denominator as integers.

Implementation

factory BigRational.from(int numerator, {int? denominator}) {
  return BigRational(BigInt.from(numerator),
      denominator: BigInt.from(denominator ?? 1));
}