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

**URL:** <https://discourse.julialang.org/t/fraction-numerator-denominator-existing-package/40520>\
**Category:** General Usage\
**Tags:** package, recommendations\
**Created:** [May 31, 2020, 9:24pm UTC](https://discourse.julialang.org/t/fraction-numerator-denominator-existing-package/40520 "2020-05-31T21:24:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tkluck](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkluck/32/15769_2.png) [@tkluck](https://discourse.julialang.org/u/tkluck)\
**Post date:** [May 31, 2020, 9:24pm UTC](https://discourse.julialang.org/t/fraction-numerator-denominator-existing-package/40520/1 "2020-05-31T21:24:53Z")

</div>

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`?

---

<div class="post-metadata">

**Author:** ![Oscar\_Smith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oscar_smith/32/25343_2.png) [@Oscar\_Smith](https://discourse.julialang.org/u/Oscar_Smith)\
**Post date:** [May 31, 2020, 9:26pm UTC](https://discourse.julialang.org/t/fraction-numerator-denominator-existing-package/40520/2 "2020-05-31T21:26:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![tkluck](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkluck/32/15769_2.png) [@tkluck](https://discourse.julialang.org/u/tkluck)\
**Post date:** [June 1, 2020, 6:54pm UTC](https://discourse.julialang.org/t/fraction-numerator-denominator-existing-package/40520/3 "2020-06-01T18:54:39Z")

</div>

Yeah, I also think it’s easy to write; I [basically did it here](https://github.com/tkluck/PolynomialRings.jl/blob/master/src/CommutativeAlgebras/NumberFields.jl#L43) 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.
