# Rational{Int64} variables in JuMP?

**URL:** <https://discourse.julialang.org/t/rational-int64-variables-in-jump/42048>\
**Category:** Optimization (Mathematical)\
**Created:** [June 25, 2020, 4:03pm UTC](https://discourse.julialang.org/t/rational-int64-variables-in-jump/42048 "2020-06-25T16:03:46Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![GeneralPoxter](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/generalpoxter/32/17695_2.png) [@GeneralPoxter](https://discourse.julialang.org/u/GeneralPoxter)\
**Post date:** [June 25, 2020, 4:03pm UTC](https://discourse.julialang.org/t/rational-int64-variables-in-jump/42048/1 "2020-06-25T16:03:46Z")

</div>

I’ve been trying to make an array of rationals using the @variable macro in JuMP, but I can’t seem to find out how to constrain the array to only rational values.

Does JuMP allow you to build variables with Rational type?  
If so, how?  
And if not, is there an alternative?

---

_[View the full topic](https://discourse.julialang.org/t/rational-int64-variables-in-jump/42048)._
