diff --git a/macros/contextFraction.pl b/macros/contextFraction.pl index bc5d71f731..2e2528a0c4 100644 --- a/macros/contextFraction.pl +++ b/macros/contextFraction.pl @@ -256,6 +256,7 @@ sub Init { $context->{value}{Real} = "context::Fraction::Real"; $context->{parser}{Value} = "context::Fraction::Value"; $context->{parser}{Number} = "Parser::Legacy::LimitedNumeric::Number"; + $context->{precedence}{Fraction} = $context->{precedence}{Infinity} + .5; # Fractions are above Infinity $context = $main::context{'Fraction-NoDecimals'} = $context->copy; $context->{name} = "Fraction-NoDecimals"; @@ -643,6 +644,7 @@ sub promote { return (bless {data => [$x->value,1], context => $context}, $class) if Value::isReal($x); return (bless {data => [$x,1], context => $context}, $class) if Value::matchNumber($x); } + return $x if Value::isValue($x) && $x->classMatch("Infinity"); return $self->new($context,$x,@_); }