Skip to content

Commit

Permalink
Version 22.07
Browse files Browse the repository at this point in the history
  • Loading branch information
trizen committed Jul 16, 2022
1 parent 1a7812a commit 97d776f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 18 deletions.
2 changes: 1 addition & 1 deletion bin/sidef
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,7 @@ Outputs:
The interactive mode (a.k.a. REPL) is available by simply executing the C<sidef> command, or by specifying the C<-i> command-line switch:
$ sidef -i
Sidef 22.05, running on Linux, using Perl v5.34.1.
Sidef 22.07, running on Linux, using Perl v5.36.0.
Type "help", "copyright" or "license" for more information.
>> n = 41
#1 = 41
Expand Down
2 changes: 1 addition & 1 deletion lib/Sidef.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package Sidef {
use utf8;
use 5.016;

our $VERSION = '22.05';
our $VERSION = '22.07';

our $SPACES = 0; # the current number of indentation spaces
our $SPACES_INCR = 4; # the number of indentation spaces
Expand Down
34 changes: 18 additions & 16 deletions scripts/Extended tests/binomialmod.sf
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,24 @@ assert_eq(binomialmod(1e10, 1e4, next_prime(2**64)**2), binomial(1e10, 1e4) % ne
assert_eq(binomialmod(1e10, 1e4, prev_prime(2**64)), binomial(1e10, 1e4) % prev_prime(2**64))
assert_eq(binomialmod(1e10, 1e4, next_prime(2**64)), binomial(1e10, 1e4) % next_prime(2**64))

assert_eq(binomialmod(1e10, 1e3, (2**127 + 1)), binomial(1e10, 1e3) % (2**127 + 1))
assert_eq(binomialmod(1e10, 1e3, (2**127 - 1)), binomial(1e10, 1e3) % (2**127 - 1))
assert_eq(binomialmod(1e10, 1e5, (2**127 - 1)), binomial(1e10, 1e5) % (2**127 - 1))
assert_eq(binomialmod(1e10, 1e5, (2**127 + 1)), binomial(1e10, 1e5) % (2**127 + 1))

assert_eq(binomialmod(1e10, 1e10 - 1e5, (2**127 - 1)), binomial(1e10, 1e5) % (2**127 - 1))
assert_eq(binomialmod(1e10, 1e10 - 1e5, (2**127 + 1)), binomial(1e10, 1e5) % (2**127 + 1))
assert_eq(binomialmod(1e10, 1e10 - 1e5, (2**127 + 1)**2), binomial(1e10, 1e5) % (2**127 + 1)**2)

assert_eq(binomialmod(1e10, 1e5, (2**127 - 1)**2), binomial(1e10, 1e5) % (2**127 - 1)**2)
assert_eq(binomialmod(1e10, 1e4, (2**128 - 1)**2), binomial(1e10, 1e4) % (2**128 - 1)**2)
assert_eq(binomialmod( 1e7, 1e5, (2**128 - 1)**2), binomial(1e7, 1e5) % (2**128 - 1)**2)

assert_eq(binomialmod(4294967291 + 1, 1e5, 4294967291**2), binomial(4294967291 + 1, 1e5) % 4294967291**2)
assert_eq(binomialmod(2**60 - 99, 1e5, prev_prime(1e9)), binomial(2**60 - 99, 1e5) % prev_prime(1e9))
assert_eq(binomialmod(2**60 - 99, 1e5, next_prime(2**64)), binomial(2**60 - 99, 1e5) % next_prime(2**64))
if (Number(Number.ULONG_MAX) > 2**32) {
assert_eq(binomialmod(1e10, 1e3, (2**127 + 1)), binomial(1e10, 1e3) % (2**127 + 1))
assert_eq(binomialmod(1e10, 1e3, (2**127 - 1)), binomial(1e10, 1e3) % (2**127 - 1))
assert_eq(binomialmod(1e10, 1e5, (2**127 - 1)), binomial(1e10, 1e5) % (2**127 - 1))
assert_eq(binomialmod(1e10, 1e5, (2**127 + 1)), binomial(1e10, 1e5) % (2**127 + 1))

assert_eq(binomialmod(1e10, 1e10 - 1e5, (2**127 - 1)), binomial(1e10, 1e5) % (2**127 - 1))
assert_eq(binomialmod(1e10, 1e10 - 1e5, (2**127 + 1)), binomial(1e10, 1e5) % (2**127 + 1))
assert_eq(binomialmod(1e10, 1e10 - 1e5, (2**127 + 1)**2), binomial(1e10, 1e5) % (2**127 + 1)**2)

assert_eq(binomialmod(1e10, 1e5, (2**127 - 1)**2), binomial(1e10, 1e5) % (2**127 - 1)**2)
assert_eq(binomialmod(1e10, 1e4, (2**128 - 1)**2), binomial(1e10, 1e4) % (2**128 - 1)**2)
assert_eq(binomialmod( 1e7, 1e5, (2**128 - 1)**2), binomial(1e7, 1e5) % (2**128 - 1)**2)

assert_eq(binomialmod(4294967291 + 1, 1e5, 4294967291**2), binomial(4294967291 + 1, 1e5) % 4294967291**2)
assert_eq(binomialmod(2**60 - 99, 1e5, prev_prime(1e9)), binomial(2**60 - 99, 1e5) % prev_prime(1e9))
assert_eq(binomialmod(2**60 - 99, 1e5, next_prime(2**64)), binomial(2**60 - 99, 1e5) % next_prime(2**64))
}

var upto = 10
for n in (-upto .. upto), k in (-upto .. upto), m in (-upto .. upto) {
Expand Down

0 comments on commit 97d776f

Please sign in to comment.