Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introducing $*RAT-UPGRADE-CLASS #4299

Merged
merged 5 commits into from Jan 4, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/core.c/Rat.pm6
Expand Up @@ -79,8 +79,8 @@ sub DIVIDE_NUMBERS(
)
}

# Initialize the $*RAT-UPGRADE-CLASS dynamic var so that it can be used
PROCESS::<$RAT-UPGRADE-CLASS> = Num;
# Initialize the $*RAT-UPGRADE-POLICY dynamic var so that it can be used
PROCESS::<$RAT-UPGRADE-POLICY> = Num;
lizmat marked this conversation as resolved.
Show resolved Hide resolved

# ALL RATIONALS MUST BE NORMALIZED, however in some operations we cannot
# ever get a non-normalized Rational, if we start with a normalized Rational.
Expand All @@ -93,7 +93,7 @@ multi sub CREATE_RATIONAL_FROM_INTS(Int:D \nu, Int:D \de, \t1, \t2) is raw {
nqp::p6bindattrinvres(nqp::create(Rat),Rat,'$!numerator',nu),
Rat,'$!denominator',de
)
!! $*RAT-UPGRADE-CLASS.UPGRADE-RAT(nu, de)
!! $*RAT-UPGRADE-POLICY.UPGRADE-RAT(nu, de)
lizmat marked this conversation as resolved.
Show resolved Hide resolved
}

# already a FatRat, so keep that
Expand Down