Documentation

Std.Internal.Rat

Rational numbers for implementing decision procedures. We should not confuse them with the Mathlib rational numbers.

Instances For
    Equations
    Instances For
      Equations
      • a.isInt = (a.den == 1)
      Instances For
        Equations
        • a.mul b = { num := a.num.tdiv (a.num.natAbs.gcd b.den) * b.num.tdiv (a.den.gcd b.num.natAbs), den := b.den / a.num.natAbs.gcd b.den * (a.den / a.den.gcd b.num.natAbs) }
        Instances For
          Equations
          • a.div b = a.mul b.inv
          Instances For
            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              Equations
              • a.floor = if (a.den == 1) = true then a.num else let r := a.num.tmod a.den; if a.num < 0 then r - 1 else r
              Instances For
                Equations
                Equations
                • Std.Internal.Rat.instOfNat = { ofNat := { num := n, den := 1 } }