In pursuit of a function to force unsimplified fractions


There are many related functions (Holdxxx,Evaluate,Unevaluated,Inactivated...), I can't seem to get any combination of them to work. "HoldFirst" doesn't work for cyring out loud. Of course,


works just fine for seeing the thing, but I lose the ability to use this object in calculations. Is there an elegant way to tell Mathematica to "chill out" for the fraction part while still doing the numerator multiplication? (without having to resort to throwing away all the symbolic goodness and "evaluability" of the fraction).

  • 1
    $\begingroup$ "...HoldFirst doesn't work for crying out loud..." - because it's a function attribute, and not a function itself. Do you have an explicit example that you want to see in a held form? $\endgroup$ Jan 18, 2021 at 2:05
  • $\begingroup$ My bad, intended use of HoldFirst would be as an attribute of Quotient. Still no dice; I think Hold is the wrong word. I want 'Numerator[x]d/Denominator@x' to be fully evaluated and simplified as if it were an isolated expression, and no other simplification to occur. forceden[2/3,9] should yield 6/9 $\endgroup$
    – Adam
    Jan 18, 2021 at 7:11
  • 1
    $\begingroup$ Would forceden[r_Rational, d_Integer?Positive] := With[{f = Quotient[d, Denominator[r]]}, Internal`RationalNoReduce[f Numerator[r], d]] suit your needs, then? $\endgroup$ Jan 18, 2021 at 7:46
  • $\begingroup$ Yes! Thank you; going to browse more Internal` functions now $\endgroup$
    – Adam
    Jan 18, 2021 at 7:55
  • $\begingroup$ Also, we do not do things like add "[SOLVED]" in titles here. If you don't mind waiting, I will write a more elaborate response later. $\endgroup$ Jan 18, 2021 at 8:00

2 Answers 2


OK, just to put it on record: there is an undocumented function, Internal`RationalNoReduce[] (see also Chip's answer here) that effectively allows you to represent a fraction not reduced to lowest terms, but can still act as a number:

Internal`RationalNoReduce[3, 6]


Thus, what the OP wants can be done like so:

forceden[r_Rational, d_Integer?Positive] := With[{f = Quotient[d, Denominator[r]]},
         Internal`RationalNoReduce[f Numerator[r], d]]

For instance,

forceden[2/3, 9]

" forceden[2/3,9] should yield 6/9 "

forceden[x_, d_] := 
  Numerator[x] d/Denominator[x]/HoldForm[d]

ff = forceden[2/3, 9]
(*   6/9   *)

ff // ReleaseHold
(*   2/3   *)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.