The statement Numerator[6/8] evaluates to 3. Numerator[Hold[6/8] does not work. What function NewNumerator[6/8] evaluates to 6?
Mathematica Stack Exchange is a question and answer site for users of Wolfram Mathematica. It only takes a minute to sign up.
Sign up to join this communityThe statement Numerator[6/8] evaluates to 3. Numerator[Hold[6/8] does not work. What function NewNumerator[6/8] evaluates to 6?
Numerator[Unevaluated[6/8]]
$\endgroup$Extract[]
on the held fraction? $\endgroup$num[frac_] := frac[[1, 1]]
den[frac_] := 1/frac[[1, 2]]
num@HoldForm[6/8]
den@HoldForm[6/8]
$\endgroup$