`Fraction{Numerator, Denominator}`: existing package?

Does anyone know of a package that offers a type like Rational but that allows different types for numerator and denominator, and types that are not necessarily <: Integer?

1 Like

I’m not aware of one, but this should be pretty easy to build yourself if you need it. What’s the usecase?

1 Like

Yeah, I also think it’s easy to write; I basically did it here and I’ve run into other places where I should have but was too lazy.

The use cases I’m thinking of are:

  • fraction fields of polynomial rings
  • vectors of rationals are sometimes better represented as a Tuple{Vector{<:Integer}, Integer}

but there may be more.

2 Likes