Is there any way to prevent clojure from making for example a 2/5 from 6/15? I need for a function to have the original denominators of ratios, hence the question.
There is no way to prevent clojure from making 2/5 from 6/15. This is most readily apparent from the equality of clojure.lang.Ratio defined here. Preserving the original unreduced version would break equality.
This sounds like a datatype problem. You are putting information into a type that doesn't preserve the amount of data that you need. Fundamentally you are putting two numbers into a ratio datatype which is a single scalar value. You'll (most probably) need to thread more information through or delay the conversion into a ratio.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With