I need to set something up whereby the result of 10/4 = 10/4, not 2.5. Basically if the result isn't an integer, I need my calculation to remain as an integer, even if that means it remains as a fraction.
www.sagemath.com equations seem to permit this, but I can't seem to get C++ to do that. The conversion to decimal keeps screwing up my equations.
Only solution I've found is semi-complicated and adds additional calculations I don't need.
Currently my divisions are resulting in 0 (because I'm using 256 and 512 bit integers).
I think you've got a good idea, but I still need to be able to use these fractions with other equations in the program such that they never fully divide unless I'm working with only an integer. As soon as I re-apply your code, I think it'd simplify.
JLBorges, That was perfect! (EDIT: removed questions etc that I was able to answer for myself)
How do I MOD this number and or convert it back into the "INTEGER_TYPE" it was before I rational<>'d it? When I make the same int = the rational<>'d number it throws an error.