Skip to main content

Fractions

Answered

Comments

1 comment

  • Tobias Achterberg
    Gurobi Staff Gurobi Staff

    For fractions you can of course just multiply the whole constraint by the smallest common multiplier of your denominators. So, instead of writing 1/3x + 2y <= 7 you would write x + 6y <= 21. For roots or other irrational numbers, there is no better way than using floating points.

    In any case, you should always use double precision in your calculations to get the floating point values, and you should not truncate digits. So, please don't write 1.414214x + y <= 5, but instead write 1.414213562373095x + y <= 5.

    Regards,

    Tobias

     

    1

Please sign in to leave a comment.