"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/core.c/Numeric.pm6" between
rakudo-2020.09.tar.gz and rakudo-2020.10.tar.gz

About: Rakudo is a compiler for the Raku Pogramming Language (formerly known as Perl 6).

Numeric.pm6  (rakudo-2020.09):Numeric.pm6  (rakudo-2020.10)
skipping to change at line 242 skipping to change at line 242
# rest of infix:<div> is in Int.pm6 # rest of infix:<div> is in Int.pm6
proto sub infix:<%>($?, $?, *%) is pure {*} proto sub infix:<%>($?, $?, *%) is pure {*}
multi sub infix:<%>() { Failure.new("No zero-arg meaning for infix:<%>") } multi sub infix:<%>() { Failure.new("No zero-arg meaning for infix:<%>") }
multi sub infix:<%>($x) { $x } multi sub infix:<%>($x) { $x }
multi sub infix:<%>(\a, \b) { a.Real % b.Real } multi sub infix:<%>(\a, \b) { a.Real % b.Real }
proto sub infix:<%%>($?, $?, *%) is pure {*} proto sub infix:<%%>($?, $?, *%) is pure {*}
multi sub infix:<%%>() { Failure.new("No zero-arg meaning for infix:<%%>") } multi sub infix:<%%>() { Failure.new("No zero-arg meaning for infix:<%%>") }
multi sub infix:<%%>($) { Bool::True } multi sub infix:<%%>($) { Bool::True }
multi sub infix:<%%>(Int:D \a, Int:D \b) {
nqp::if(
nqp::isbig_I(nqp::decont(a)) || nqp::isbig_I(nqp::decont(b)),
nqp::if(
b,
!nqp::mod_I(nqp::decont(a),nqp::decont(b),Int),
Failure.new(
X::Numeric::DivideByZero.new(using => 'infix:<%%>', numerator => a)
)
),
nqp::if(
nqp::isne_i(b,0),
nqp::hllbool(nqp::not_i(nqp::mod_i(nqp::decont(a),nqp::decont(b)))),
Failure.new(
X::Numeric::DivideByZero.new(using => 'infix:<%%>', numerator => a)
)
)
)
}
multi sub infix:<%%>(\a, \b) { multi sub infix:<%%>(\a, \b) {
nqp::if( nqp::if(
b, b,
(a.Real % b.Real == 0), (a.Real % b.Real == 0),
Failure.new( Failure.new(
X::Numeric::DivideByZero.new(using => 'infix:<%%>', numerator => a) X::Numeric::DivideByZero.new(using => 'infix:<%%>', numerator => a)
) )
) )
} }
proto sub infix:<lcm>($?, $?, *%) is pure {*} proto sub infix:<lcm>($?, $?, *%) is pure {*}
multi sub infix:<lcm>(Int:D $x = 1) { $x }
multi sub infix:<lcm>(\a, \b) { a.Int lcm b.Int } multi sub infix:<lcm>(\a, \b) { a.Int lcm b.Int }
proto sub infix:<gcd>($?, $?, *%) is pure {*} proto sub infix:<gcd>($?, $?, *%) is pure {*}
multi sub infix:<gcd>() { Failure.new('No zero-arg meaning for infix:<gcd>') } multi sub infix:<gcd>() { Failure.new('No zero-arg meaning for infix:<gcd>') }
multi sub infix:<gcd>(Int:D $x) { $x }
multi sub infix:<gcd>(\a, \b) { a.Int gcd b.Int } multi sub infix:<gcd>(\a, \b) { a.Int gcd b.Int }
proto sub infix:<**>($?, $?, *%) is pure {*} proto sub infix:<**>($?, $?, *%) is pure {*}
multi sub infix:<**>($x = 1) { $x.Numeric } multi sub infix:<**>($x = 1) { $x.Numeric }
multi sub infix:<**>(\a, \b) { a.Numeric ** b.Numeric } multi sub infix:<**>(\a, \b) { a.Numeric ** b.Numeric }
proto sub postfix:<ⁿ>($, $, *%) is pure {*} proto sub postfix:<ⁿ>($, $, *%) is pure {*}
multi sub postfix:<ⁿ>(\a, \b) { a ** b } multi sub postfix:<ⁿ>(\a, \b) { a ** b }
## relational operators ## relational operators
 End of changes. 3 change blocks. 
21 lines changed or deleted 0 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)