2
$\begingroup$

The statement Numerator[6/8] evaluates to 3. Numerator[Hold[6/8] does not work. What function NewNumerator[6/8] evaluates to 6?

$\endgroup$
3
  • 5
    $\begingroup$ Numerator[Unevaluated[6/8]] $\endgroup$
    – ciao
    May 19, 2015 at 18:20
  • 1
    $\begingroup$ Why not use Extract[] on the held fraction? $\endgroup$ May 19, 2015 at 18:21
  • $\begingroup$ num[frac_] := frac[[1, 1]] den[frac_] := 1/frac[[1, 2]] num@HoldForm[6/8] den@HoldForm[6/8] $\endgroup$
    – martin
    May 19, 2015 at 20:52

0

Browse other questions tagged or ask your own question.