Releases: trizen/sidef
Releases · trizen/sidef
Version 24.11
Additions
- Added the Array
.isort
and.isort_by{...}
methods. (558edae) - Added the Array
.skip(n)
,.skip_last(n)
and.skip_by { ... }
methods. (dba4feb) - Added the Number
farey(n)
method. (c392646) - Added the Number
farey_neighbors(n, p/q)
method. (ec8e01d) - Added the Number
egypt_greedy(p/q)
method. (262b1a5) - Added the String
sayf(format_str, ...)
method. (17ea7e1) - Added the String
.byte(n)
method. (a561092) - Added the String
.head
and.tail
aliases for.first
and.last
methods. (a561092) - Added the String
.cons(n)
and.each_cons(n, {...})
methods. (9b4a54b) - Added the FileHandle
.get_byte
method. (532056c) - Added the FileHandle
.printlnf()
method (also aliased assayf
). (0d9ec08)
Improvements
- Funnier parsing error-messages, generated with Chat GPT. (adabed4)
- Extended the FileHandle
.new_buf()
method, to accept an optional initial string. (5745d87) - Extended the
given/when
statement to support a block, testing for trueness. (019350a) - Better performance in Number
nth_powerfree(n,k)
for large enoughn
(>10^30). (94bfebe, 14a1ee2, 9b4a54b) - Simplified the
liouville_sum
function for slightly better performance. (61f50c7)
Changes
- Renamed the Array and String method
jaro_distance
tojaro
. (f7e725f)
Bug-fixes
- Fixed a minor issue in
Perl.to_sidef()
method. (2d6af54) - Fixed Number
mertens(n)
for non-native values ofn
. (61f50c7) - Guard against "Modification of a read-only value attempted" errors. (0f8b1ab)
Full Changelog: 24.05...24.11
Version 24.05
Additions
- Added the Number
fibonorial(n)
method. (b811901) - Added the Number
is_primitive_abundant(n)
method. (eb11b34) - Added several aliases for trigonometric functions. (4aa0032)
Improvements
- Several minor optimizations in the Number class. (40c23f8)
- Slightly better performance in Number
powerful_count
. (387da41) - Slightly faster generation of k-powerful numbers in a given range. (100f7d8)
- No longer do trial division for small
n
inis_carmichael(n)
. (02b1ab3) - Slightly less overhead in RangeNumber
iter
for native integers andstep=1
. (5521bbf) - Number
_primality_pretest()
: whenn > 10^50_000
, try gcd withprimorial(10^9)
(on 64-bit systems). (2e99031)
Changes
- Parse 'ZERO WIDTH SPACE' (
U+200B
) as whitespace. (2f6a1f8) - Return false from Number
is_strong_psp(n, b)
whengcd(n,b) != 1
. (f72e891, 9b833eb) - Reimplemented Number
is_pseudoprime(n,b)
for better consistency. (f72e891)
Bug-fixes
- No longer
use VERSION
ineval()
(ready for Perl 5.40). (acdaf87) - Fixed
gcd(-n)
andlcm(-n)
to returnn
instead of-n
. (5d478d9) - Fixed the deparsing of an empty array that contains empty expressions, under
-O1
. (9547182)
All changes: 24.01...24.05
P.S.: This is a minor release, preparing Sidef for Perl 5.40.
Version 24.01
Additions
- Added the Number
Num!USE_PFGW
class-variable. (disabled by default) (04e7c13, 65ee349) - Added the Number
znlog(a, g, m)
method. (c9ba93e) - Added the Number
geometric_summod(n, r, m)
method. (fe5852e) - Added the Number
centered_pyramidal(n,k)
method. (0f76bd9) - Added the Number
centered_pyramidal_root(n,k)
method. (0f76bd9) - Added the Number
antidivisors(n)
andantidivisor_count(n)
methods. (c733f79) - Added the Number
antidivisor_sum(n)
method. (d8d9ca3) - Added the Number
pisano_period(n)
method. (2b750d7) - Added the Number
solve_quadratic_form(d, n)
method. (de88fe0) - Added the Number
smod(a, m)
method. (aa825ef) - Added the Number
germain_factor(n)
method. (ac72a2b) - Added the Block
{ ... }.nest(n, initial_value=0)
method. (f904fc4) - Added the Array
.summod(m)
and.prodmod(m)
methods. (12dc78b) - REPL: added support for executing a Sidef script in interactive mode (
-i
). (f1c1848)
Improvements
- Much faster generation of Carmichael and Lucas-Carmichael numbers with few prime factors. (6925ddc)
- Slightly better performance in generating native pseudoprimes. (426346e)
- Optimized Number
idiv_ceil(a,b)
for native positive integers. (0a9cd66) - Slightly faster generation of pseudoprimes (Carmichael, Lucas-Carmichal and Fermat). (0a9cd66)
- Call
_primality_pretest(n)
from_is_prob_prime(n)
for large enoughn
. (8dc1329) - Ignore trial-division factors when looking for special factors in Number
_factor(n)
. (30aead5) - Minor tweaks in
is_almost_prime(n,k)
andis_omega_prime(n,k)
for slightly better performance. (30f35b6) - Slightly better performance in Number
is_prob_prime(n)
andall_prime(...)
forn < 10^1000
. (858add2) - Optimized Number
ipow2(n)
andipow10(n)
when the result is a native integer. (b787581) - Optimized Number
n.remove(k)
for native integers. (d99908c) - Less overhead in Number
_big2istr()
,_big2uistr
and_big2pistr()
private functions. (164425c) - Slightly better performance in Number
is_mersenne_prime
. (038de75) - Optimized Number
factorial_valuation(n,p)
for native integers. (67377c2) - Several optimizations in the Number class for native integers. (204dc7d)
- Better performance in Number
is_carmichael(n)
andis_lucas_carmichael(n)
. (74c5901, 294f4a3, 25df4d7)
Changes
- Stringify
PolyMod
objects asx^k + ... + c (mod m)
. (6847de6)
Bug-fixes
- Workaround for a bug in interactive mode. (5930a89)
- Allow
Set
andBag
objects to be used as arrays. (3202fad) - Minor fix in
lucas_factor(n,j,tries)
whenj
isnil
. (25327ca) - REPL: add typed words to auto-completion only when the code is valid. (731abe5)
- REPL: allow variable declarations in interactive mode to contain empty lines. (1e97aae)
- REPL: allow lines to extend over multiple lines, by using the backslash (
\
) character. (5930a89) - Fixed a minor issue in Number
is_powerful(n,k)
: return false ifn
is negative andk == 1
. (2074f27)
All changes: 23.11...24.01
Version 23.11
Additions
- Added the
PolyMod([...], m)
built-in class. (fe8303d) - Added the PolyMod
chinese(...)
method. (fada375) - Added the Gauss
factor(z)
andfactor_exp(z)
methods. (8827635) - Added the Gauss
divisors(z)
method. (805442f) - Added the Number
is_bfsw_psp(n)
method. (762af27) - Added the Number
totient_range(a,b)
method. (17aa258) - Added the Number
proper_sigma0(n)
method. (17aa258) - Added the Number
proper_divisors(n)
method. (17aa258) - Added the Number
mobius_range(n)
method. (17aa258) - Added the Number
is_deficient(n)
method. (17aa258) - Added the Number
is_amicable(n,m)
method. (17aa258) - Added the Number
linear_congruence(n, r, m)
method. (219320b) - Added the Number
bphi(n)
method. (a121ecd) - Added the Number
iphi(n,k=1)
method. (68049c4) - Added the Number
nuphi(n)
method. (8bd9444) - Added several more Polynomial methods. (4d18279)
Improvements
- Optimization in Number
modular_quadratic_formula(a,b,c,m)
whengcd(2*a, m) == 1
. (6f88a08) - Return ealry if input is a prime number in Number
special_factor(n)
. (bae4ff1) - Extended the Number
aliquot(n)
method to accept an extra argument. (17aa258) - Minor optimization in Number
trial_factor(n,lim)
. (1b781e9) - Minor performance improvements in Number
is_powerful(n,k)
. (455eeed) - Optimized Number
is_div(n,k)
for native integers. (15dc482) - Better performance in Number
k.powerful_count(n)
for non-nativen
. (9d131a7) - Optimized the Number
divisors(n,k)
method for better performance. (e662b70) - Generalized the Number
phi
anduphi
methods to accept an extra argument. (af72440)
Bug-fixes
- Fixed an issue in Number
modular_quadratic_formula(x,y,z,m)
forx != 1
. (219320b) - Fixed a minor issue in Number
irand(0,x)
. (f92fbc5) - Fixed two rare issues in Number
is_almost_prime(n,k)
andis_omega_prime(n,k)
. (bc745eb) - bin/sidef: add to history only words <= 50 chars in length. (6e4ba2a)
- Make
Range::Range
,Block::Try
andBlock::Fork
real objects, by inheriting fromSidef::Object::Object
. (5322489)
All changes: 23.10...23.11
Version 23.10
Additions
- Added the Number
Num!USE_PARI_GP
class-variable (disabled by default). (12fe3db bd13ad0) - Added the Number
Num!USE_CONJECTURES
class-variable (disabled by default). (43b8165) - Added the Number
is_bfw_psp(n)
method. (218aa60) - Added support for parsing polynomials as
Poly(str)
. (819a5ae) - Added the Array
.bsearch_min{...}
,.bsearch_max{...}
,.bindex_min{...}
and.bindex_max{...}
methods. (70d81cb) - Added the
File.link
andFile.symlink
methods. (cf029ea 379f1a6) - Added support for method-name completion in the REPL. (3d5c1ba 1d2f6a9)
- Added the Array
arr.ordered_partitions(k, { ... })
method. (6378d47)
Improvements
- Extended the
include("file.sf")
statement. (865857f) - Use a cryptographically-secure pseudorandom number generator in the Number
irand
method. (5e5c7e4) - Improved the Number
primality_pretest(n)
method forn > 10^1000
. (38f844b) - Better performance in computing the modular Lucas V and U sequences. (1dbbf7e, 919bfb3)
- Use
is_almost_extra_strong_lucas_pseudoprime
in Numberall_prime
andis_safe_prime
. (d066781) - Slightly better performance in the generation of native k-powerful numbers. (5e5c7e4)
- Slightly better performance in Number
is_square(n)
,is_cube(n)
andis_power(n,k)
for native integers. (3bbff08) - Minor performance tweaks inside Number
special_factor(n)
. (68a6048) - Better bounds in Number
nth_powerfree(n,k)
fork = 2
. (e001622) - Much better performance in Number
next_perfect_power(n)
andprev_perfect_power(n)
. (81af8f0)
Changes
- Changed the Number
is_prob_prime(n)
method to use the Frobenius-Underwood test. (38f844b) - Perl.to_sidef(): parse numbers with a decimal point, as floating-point numbers. (4f34c47)
- Return a
Sidef::Module::OO
object fromBlock.thread()
. (76c87b2)
Bug-fixes
- No longer
use integer
in Numbersmooth_count
. (2be1792) - Extended the Matrix
.pow(n)
method to accept an arbitrary large integer. (574d6a5) - Fixed a performance issue in Number
prime_count(a,b)
whena
andb
are close to each other. (7e53839) - Fixed a segmentation fault in Regex
lt
,le
,gt
andge
methods. (9626332) - Fixed a segmentation fault in Array
.le
,.lt
,.gt
and.ge
methods. (5d543a8) - Fixed a right-shift issue for native integers with
perl < 5.24.0
. (67a636a d1ee265)
All changes: 23.08...23.10
Version 23.08
Additions
- Added the
Num!USE_PRIMESUM
class-variable. (disabled by default) (28e2ac3) - Added the Number
lpf_sum(a,b)
method. (9c70da2) - Added the Number
gpf_sum(a,b)
method. (096ead5) - Added the Number
k.squarefree_almost_prime_sum(a,b)
method. (601bb75) - Added the Number
k.almost_prime_sum(a,b)
method. (6b1d971) - Added the Number
prime_power_sum(n)
method. (90d77d9) - Added the Number
k.omega_prime_sum(a,b)
method. (d238139) - Added the Number
k.power_count(a,b)
andk.power_sum(a,b)
methods. (19cd8c9) - Added the Number
perfect_power_sum(n)
method. (c799a1c) - Added the Number
nth_perfect_power(n)
method. (ab462f6) - Added the Number
next_perfect_power(n,k=nil)
andprev_perfect_power(n,k=nil)
methods. (5c195e3) - Added the Number
prev_prime_power(n)
method. (e51de62) - Added the Number
n.prev_omega_prime(k=2)
method. (44c3723) - Added the Number
prev_semiprime(n)
method. (ad8928b) - Added the Number
prev_almost_prime(n,k)
method. (ad8928b) - Added the Number
prev_squarefree(n)
method. (cb6917d) - Added the Number
next_squarefree_semiprime(n)
method. (a6e26d0) - Added the Number
n.prev_powerfree(k=2)
method. (8457fd4) - Added the Number
n.prev_powerful(k=2)
method. (8d4907f) - Added the Number
n.prev_squarefree_semiprime
method. (6da4bba) - Added the Number
n.prev_squarefree_almost_prime(k=2)
method. (6da4bba) - Added the Number
nth_nonpowerfree(n,k)
method. (6cc777f) - Added the Number
next_nonpowerfree(n,k=2)
andprev_nonpowerfree(n,k=2)
methods. (809aa9b) - Added the Number
muladdmulmod(a, b, c, d, m)
andmulsubmulmod(a, b, c, d, m)
methods. (9e230f4) - Added the Number
muladdmod(a,b,c,m)
,mulsubmod(a,b,c,m)
andsubmulmod(a,b,c,m)
methods. (d50ffde) - Added several
cube_*
andcubefree_*
aliases for3.power_*
and3.powerfree_
. (bb0784e) - Added the FileHandle
.rewind
method. (3b40438) - Added the String
.codes
method. (6da6122) - Added the Range
.sort {|a,b| ... }
and.sort_by {|v| ... }
methods. (1eacc45)
Improvements
- Extended the Number
fibmod
method to accept 3 arguments. (b79e09d) - Extended
expnorm(n,b)
to accept any value for baseb
, including a complex number. (b79e09d) - Use
primecount --phi
in Numberk.rough_count(n)
whenNum!USE_PRIMECOUNT
is enabled. (28e2ac3) - Extended
cop_factor(n)
to potentially find more factors. (a2cdf75) - Allow the Number
gamma
method to be called asNum.gamma
, returning the Euler-Mascheroni constant. (b79e09d) - Added a few more terms in the lookup table for
mertens(2**n)
andmertens(2**n)
. (e9ebca0) - bin/sidef: added the
faith
rounding option for-M
, which does faithful rounding (withmpfr >= 4.0.0
). (fde163a) - Better performance in
is_omega_prime(n,k)
andis_almost_prime(n,k)
for largen
. (abc0c1e) Num(str, base)
now returns a blessed native integer, when possible. (47aa40a)- Added a few more terms in the Number
almost_prime_count()
lookup tables. (56b16a3) - Better performance in Number
nth_almost_prime(n,k)
when the result doesn't fit inside a native integer. (b6afa3d) - Better performance in Number
k.almost_primes(a,b)
andk.omega_prime_count(a,b)
when the GitHub version of Math::Prime::Util is installed. - Better performance in Number
fibonacci(n,k)
fork >= 3
and large enoughn
. (bf9f8b9) - Added internal cache inside the Number
_is_prob_prime
internal function. (7697083)
Changes
- Renamed the Number
k.non_powerfree(a,b)
method tok.nonpowerfree(a,b)
. (384eb06) - Reimplemented the Array and String
.slice(offset, length)
methods. (68d11ff, 11887b8, 724882e) - Renamed the Number
.partitions
method to.partition_count
, which better reflects what it returns. (34c2fc9) - Renamed the Number
*squareful*
and*cubeful*
methods to*squarefull*
and*cubefull*
respectively. (5433491)
Bug-fixes
- Added a better defined Array
.ft(i,j)
method. (724882e) - Fixed the
help
command inside the REPL. (efa54f1) - Fixed the code generation for a hash-lookup applied on the result of a prefix method-call. (4575600)
- Fixed a bug in Number
divmod(a,b,m)
introduced in version22.05
, whena
is evenly divisible byb
. (48fcbbe)
All changes: 23.05...23.08
Version 23.05
Additions
- Added support for transparently converting Perl subroutines to Sidef blocks. (36f6bc0)
- Added the
%perl{...}
and%Perl{...}
syntax for executing arbitrary Perl code. (8aa1284) - Added the
Perl.tie()
andPerl.untie()
methods. (2372474) - Added the Number
urand(a,b)
anduseed(n)
methods. (f7f6db3, 44a6c4b) - Added the Number
euler_numbers(n)
method. (4ae8698) - Added the Number
bernoulli_numbers(n)
method. (45733ff) - Added the Number
addmulmod(x, y, z, m)
method. (47c4117) - Added the Number
fubini(n)
andfubini_numbers(n)
method. (fcf86d1) - Added the Number
composite_sum(a,b,k=1)
method. (35f1f43) - Added the Number
k.powerful_sum(a,b)
method. (6984696) - Added the Number
k.non_powerfree(a,b)
method. (f2c430d) - Added the Number
k.non_powerfree_each(a, b, { ... })
method. (6b2133f) - Added the Number
k.non_powerfree_count(a,b)
andk.non_powerfree_sum(a,b)
methods. (fce0153) - Added the Number
k.powerfree(a,b)
andk.powerfree_each(a,b,{...})
methods. (5e30232) - Added the Number
is_non_powerfree(n,k)
,is_non_squarefree(n)
andis_non_cubefree(n)
methods. (1105641) - Added the Number
roots_of_unity(n)
method. (0afea1e) - Added the Fraction
inv
,powmod
andinvmod
methods. (7c3a7ec) - Added the Range
neg
method. (4a6c5a6) - Added the String
.each_slice(n, {...})
method. (b984aa2) - Added the String
.each_kv{|k,v| ... }
method. (8dca2c6) - Added the String
.uniq
method. (bbedb55) - Added the Block
.time
method. (2adaae1) - Added the Block
.bsearch
,.bsearch_le
,.bsearch_ge
andbsearch_inverse
methods. (d275993, 5bf031f) - Added the Polynomial
roots(f)
method. (a3397e8) - Added the Polynomial
newtwon_method(f, x=1i)
method. (a3397e8) - Added the File
.open_arw
method. (a5baa6c) - Added the
FileHandle.new_buf(encoding=:utf8)
class method. (a5baa6c)
Improvements
- Extended the FileHandle
<<
operator, to accept multiple arguments. (e3c6536) - Slightly better performance in Number
is_squarefree(n)
,is_powerfree(n,k)
andis_powerful(n,k)
for nativen
. (f37ac37) - Several optimizations in the Number class for native integers when Math::Prime::Util is not installed. (db4692b)
- Several optimizations in Number
ilog(n,b)
for nativen
. (18f62bd) - Better performance in Number
is_abs_euler_psp(n)
for nativen
. (2e7480a) - Slightly better performance in Number
chebyshev_factor(n)
. (2e7480a) - Better performance in Number
k.powerful_count(n)
for native and largen
. (7636988) - Slightly better performance in Number
prime_power_count(n)
,k.omega_prime_count(n)
,k.almost_prime_count(n)
andk.squarefree_almost_prime(n)
. (88a6131) - Unpack
floor(a/b)
andceil(a/b)
into a native integer, if possible. (88a6131) - Faster algorithm in Number
squarefree_count(n)
. (c36fad3) - Extended Number
nth_composite(n)
,nth_prime(n)
,nth_prime_power(n)
andnth_semiprime(n)
for non-native integersn
. (914595f) - Use
primecount
in Numbernth_prime(n)
whenn
is large enough andNum!USE_PRIMECOUNT
is enabled. (fc781e4) - Improved the Optimizer to cover more cases. (f741a5e, 68198cf, 7e284dd, 4a6c5a6)
- Optimized Number
sum(...)
for native integers. (7869c37) - Optimized Number
divmod(a,b,m)
for native integers. (b5b1117, 8b94722) - Deparser: added constant cache for literal numbers and strings. (68198cf)
- Better performance in Number
idiv(a,b)
for native inputs. (ca17233) - Slightly better performance in Number
all_prime(...)
for native inputs. (9b796c6) - Optimized Number
powmod(a,n,m)
for native inputs. (3de883d) - Optimized
n.is_coprime(k)
when eithern
ork
is a native integer. (3de883d) - Optimized
gcd(a,b)
when eithera
orb
is a native integer. (3de883d) - Slightly better performance in Number
digits2num
for native integers. (428490d, 5463548) - Better performance in Number
n.jordan_totient(k)
for largen
. (391d4ae) - Optimized Number
digits(n,b)
andsumdigits(n,b)
for native inputs. (dbff96a) - Optimized Number
n.as_bin
,n.as_oct
andn.as_hex
for native integersn
. (dbff96a) - Optimized Quadratic
div(q,n)
wheren
is a Number object. (dbff96a) - Slightly better performance in Number
is_abundant(n)
for largen
and nativen
. (cc724a2) - Perl deparser: more efficient code generation for array and hash lookups. (f137849)
- Better performance in
znorder(a,n)
andlambda(n)
for largen
. (1fd66bd) - Slightly better performance in
special_factor(n)
. (2a47419)
Changes
- REPL: dump floating-point number with
f
suffix. (daf91ad) - No longer UTF-8 encode the self-string in String
.open_r
. (e3c6536) - Modified the String
.open_r
method to accept an optional argument specifying the encoding, which by default isutf8
. (a5baa6c) - Removed several warnings from the File class. (3199b46)
- Perl deparser: re-implemented the smartmatch operator (
~~
) (12f9e2f) - Renamed the Number method
random_safe_prime(n)
torandom_nbit_safe_prime(n)
. (f741a5e) - Changed String
hex
,oct
andbin
to return0
for an empty string (instead ofNaN
). (f741a5e) - Parser: no longer parse the
+
sign as part of a number. (68198cf) - Parser: no longer parse
-
as part of a number. (4a6c5a6) - Allow numbers to contain optional whitespace when passed to
Number(...)
. (575792e)
Bug-fixes
- Fixed an issue in
Polynomial()
, when the zero coefficient is passed for a power. (787cf8d) - Fixed an issue in Number
as_cfrac(n)
for rationals and native integers. (bb30265) - Made
RAT % INT
to be consistent withINT % INT
when the modulo is negative. (7869c37) - Fixed a minor issue in
_set_int(n)
whenn
is a Perl string with leading zeros. (3de883d) - String.apply_escapes(): fixed an issue that caused binary strings to get inconsistent byte representations during -O1. (ecf99e6)
- Fixed an edge case in
is_almost_prime(n,k)
andis_omega_prime(n,k)
for numbersn
that contain the prime factor101
. (1c16e5f) - Fixed an issue Number
is_lucas_carmichael(n)
for native integersn
. (522e4ba)
All changes: 23.03...23.05
Version 23.03
Additions
- Added the Number
n.centered_polygonal(k)
method. (5ae70d1) - Added the Number
n.is_centered_polygonal(k)
method. (dea9e82) - Added the Number
n.centered_polygonal_root(k)
method. (547e34f) - Added the Number
n.pyramidal(k)
method. (3118b0a) - Added the Number
n.is_pyramidal(k)
method. (9f26b40, de32ea6) - Added the Number
n.pyramidal_root(k)
method. (0396413) - Added the Number
is_llr_prime(n,k)
method. (a3857b8) - Added the Number
is_proth_prime(n,k)
method. (6a00529) - Added the Number
fibonacci_factor(n, upto = 2*n.ilog2)
method. (a2f720e) - Added the Number
collatz(n)
method. (8c6a4fb) - Added the Number
Num!USE_FACTORDB
class variable (disabled by default). (d5e1528, 73ff49f) - Added the Number
Num!SPECIAL_FACTORS
class-variable (enabled by default). (89282fb) - Added the Number
Num!USE_YAFU
class variable (disabled by default). (92b95fa) - Added the Number
Num!VERBOSE
class-variable, to enable verbose/debug mode. (92b95fa) - bin/sidef: added the
-N options
command-line option. (ae6cabe) - Added the Dir
.find
method. (cc3570d) - Added the File and Dir
.mktemp
method. (83fb10f) - Added the String
.use
method, to load a Perl module usingeval('use ...')
. (71c94b8) - Added the String
gzip
andgunzip
methods. (8e7f33c) - Added the String
.deflate
and.inflate
methods. (644c271) - Added the
Math.for(initial, conditionBlock, nextTermBlock)
method. (56abfa5)
Improvements
- Better performance in Number
euler_phi
for largen
. (ed34df8) - Better performance in Number
sigma(n,k)
andsigma0(n)
for largen
. (2690f70) - Better performance in Number
divisors(n)
for largen
. (9b8a9a2) - Optimized the generation of squarefree pseudoprimes (~8x faster). (ab0888a)
- Faster generation of native non-squarefree Fermat pseudoprimes. (5647bc2)
- Much faster generation of non-squarefree Fermat pseudoprimes. (2addc09, 5925312, d4af502)
- Several optimizations in the Number class. (689de07, 086efe6, 3ae877d, 2d3d98f)
- Optimized Number
is_lucas_carmichael(n)
for nativen
. (14ae1a3) - Better performance in Number
n.is_psp(b)
andn.is_strong_psp(b)
for nativen
. (f85b88c) - Slightly better performance in Number
is_squarefree_almost_prime(n,k)
for medium-sized integers. (1ea2a21) - Slightly better performance in Number
is_squarefree(n)
for largen
. (181de7a) - Better performance in Number
is_omega_prime(n,k)
andis_almost_prime(n,k)
. (20274fd, 180962b, efaaf5a) - Extended
_prime_count_range
to handle non-native integers (on 32-bit systems). (988d2c8, 86b77f2) - Minor performance improvement in Number
gcd(a,b)
anda
andb
are native integers. (3389ae1) - Better performance in Number
binomial(n,k)
forn <= 10^6
. (fa6303c) - Better performance in Number
cyclotomic(n,x)
andcyclotomic(n)
. (7a49fca) - Try ECM with small parameters in Number
special_factor(n)
. (30ab5cf) - Optimized Number
addmod
,submod
andmulmod
for native integer inputs. (7909260)
Bug-fixes
- Perl deparser: escape the special characters in string values. (bceaf85)
- Bug-fix: an empty block now returns nothing when called. (56abfa5)
Version 22.12
Additions
- Added the parser floating-point
f
suffix for literal numbers. (81b0991) - Added support for using native integers in arithmetic operations (when possible). (cc5638b)
- Added the Array
.solve_rec_seq
method. (9a7e3d7) - Added the Math
.solve_seq(array, offset=0)
and.solve_rec_seq(array)
methods. (9a7e3d7) - Added the Math
.linear_recurrence(ker, init, n)
method. (a45fe51) - Added the Math
.linear_recmod(ker, init, n, m)
method. (51c4688) - Added the Number
phi_finder_factor(n, tries=1e4)
method. (2605b84) - Added the Number
k.carmichael(a, b)
method. (a884fcb) - Added the Number
k.lucas_carmichael(a,b)
method. (a884fcb) - Added the Number
k.squarefree_fermat_psp(base, a,b)
method. (a884fcb) - Added the Number
k.carmichael_each(a,b,{...})
method. (c53381a) - Added the Number
k.lucas_carmichael_each(a,b,{...})
method. (c53381a) - Added the Number
k.squarefree_fermat_psp_each(base,a,b,{...})
method. (c53381a) - Added the Number
k.fermat_psp(base, A, B)
andk.fermat_psp_each(base, A, B, {...})
methods. (9437e8f) - Added the Number
k.squarefree_strong_fermat_psp(base, a, b)
method. (c68292a) - Added the Number
k.carmichael_strong_fermat(base, from, upto)
method. (7c9961c) - Added the Number
k.carmichael_strong_fermat_each(base, from, upto, { ... })
method. (a6376ee) - Added the Number
k.each_squarefree_strong_fermat_psp(base, from, upto, { ... })
method. (d3108eb) - Added the Number
k.strong_fermat_psp(base, from, upto)
method. (e98114d) - Added the Number
k.each_strong_fermat_psp(base, from, upto, { ... })
method. (277f5d4) - Added the Number
x.is_float
method. (e85866d) - Added the Number
aliquot(n)
method. (c1f16a8) - Added the Number
prev_composite(n)
method. (6045096) - Added the Number
n.prev_primes(start)
method. (1d76f26) - Added the Number
n.prev_composites(start)
method. (cfb857a) - Added the Number
fld
,cld
,trd
andrdd
aliases foridiv_floor
,idiv_ceil
,idiv_trunc
andidiv_round
. (76f8d8f) - Added the Number
.f
alias for.to_float
. (30b445a) - Added the RangeNumber
carmichael(a..b, k)
method. (511ca35) - Added the RangeNumber
lucas_carmichael(a..b, k)
method. (511ca35) - Added the RangeNumber
each_carmichael(a..b, k, {...})
method. (511ca35) - Added the RangeNumber
each_lucas_carmichael(a..b, k, {...})
method. (511ca35) - Added the Polynomial
rat
andrat_approx
methods. (ff011c3) - Added the Polynomial
abs(x)
,sgn(x)
,gcd(a,b)
,gcdext(a,b)
andlcm(a,b)
methods. (323aebb) - Added the Sidef
.version()
and.numeric_version()
methods. (4c60642) - Added the Perl
.version()
and.numeric_version()
methods. (4c60642) - Added the Mod
.sqr
method. (426b3d3) - Added the String
.ascii2bits
method. (6dbe816) - Added Number and RangeNumber methods for generating, counting and iterating over squarefree semiprimes. (a5b785c)
- REPL: allow
#-n
to be used, which will count backwards. (08a7c0b) - Added the
pretty
alias forstringify
in the Number classes. (6f7e128) - Added the
Sys.readline
alias forSys.scanln
. (86a15c5)
Improvements
- Better interoperability between
Polynomial()
andMod()
. (3896b9a) - Optimized Number
is_cyclic(n)
for better performance. (5b3be4f) - Optimized Number
is_lucas(n)
for better performance withn <= 10^1000
. (f49f8a6) - Optimized Number
is_lucas(n)
for native integers. (2267e2b) - Optimized Number
iroot(n,k)
for positive native values ofn
. (da4fbc5) - Optimization in Number
shift_left()
for native unsigned integers. (9ff3f81) - Optimized Number
special_factor(n)
for much better performance. (8deefb5, 2605b84) - Optimized the Number
primes(a,b)
method whenb
is a native integer. (d145135) - Optimized Number
sigma(n)
andsigma0(n)
for native integers. (9c928a8) - Several simplifications in the RangeNumber class. (7bca926)
- Several simplifications in the Polynomial class. (9eda1e0)
- Several optimizations in the Number class for native integers. (a9f071b, 4d1122e, 5ac2cda)
- Better performance in
is_almost_prime(n,k)
andis_omega_prime(n,k)
for numbers with very large factors. (f765618) - Extended
Polynomial()
to accept an array of pairs as input. (0f4339b) - Extended the Polynomial
eval()
method to recursively evaluate the values of polynomials. (7beedb8) - Extended the Number
expnorm(n,b)
method to support any b > 1, including floating-point values. (7544d9a) - Extended the Number
sum_primes
method to accept and additional argumentk
. (2c0a42b) - Less memory usage when calling the Number
inverse_*
methods with a native integer. (4bc9723)
Bug-fixes
- Fixed the stringification of an empty polynomial to
0
. (50a6bc2) - Fixed several special cases in the Number
*_factor
methods. (741399a) - Fixed several false-positives from
is_carmichael(n)
for some specialn
. (b729120)
All changes: 22.07...22.12
Version 22.07
Additions
- Added the Number
special_factors(n, tries=1)
method. (272ec42) - Added the Number
gcd_factors(n, [a,b,c,...])
method. (ef7938a) - Added the Number
pell_factor(n, tries=1e5)
method. (f6c4333) - Added the Number
cyclotomic_factor(n, bases...)
method. (39ba86f) - Added the Number
is_perfect(n)
method. (9c4c74f) - Added the Number
n.is_squarefree_almost_prime(k=2)
method. (1a7812a) - Added the Number
composite_lower(n)
andcomposite_upper(n)
methods. (6c48130) - Added the Number
composite_count_lower(n)
andcomposite_count_upper(n)
methods. (dc92b4c) - Added the Number
prime_power_lower(n)
andprime_power_upper(n)
methods. (2d5efab) - Added the Number
prime_power_count_lower(n)
andprime_power_count_upper(n)
methods. (f884606) - Added the Number
nth_omega_prime(n,k=2)
method. (bbc8923) - Added the Number
nth_almost_prime(n, k=2)
method. (3d61414) - Added the Number
nth_squarefree_almost_prime(n, k=2)
method. (271fcdb) - Added the Number
nth_powerful(n,k=2)
method. (7d8d695, e1180f3) - Added the Number
nth_prime_power(n)
method. (9e4b34e) - Added the Number
nth_squarefree(n)
method. (03006f7) - Added the Number
nth_powerfree(n,k=2)
method. (5eb73f1) - Added the Number
next_powerfree(n,k=2)
method. (5485e84) - Added the Number
next_squarefree_almost_prime(n,k=2)
method. (f1c30f5) - Added the Number
next_omega_prime(n,k=2)
method. (6023b93) - Added the Number
next_semiprime(n)
method. (4295892) - Added the Number
next_almost_prime(n,k=2)
method. (9608c7f, 8a45f5f) - Added the Number
next_powerful(n,k=2)
method. (79c5c5a) - Added the Number
next_prime_power(n)
method. (764eab5) - Added the Number
k.smooth_divisors(n)
andk.rough_divisors(n)
methods. (bee1d25) - Added the Number
prime_powers(a,b)
andprime_powers_each(a,b,{...})
methods. (ae687b8) - Added the
Math.seq(a, b, c, ..., { ... })
method. (0fd19d4, 277fe12) - Added the
Math.binary_exp(c,x,n,{|a,b| ... })
method. (57845ba) - Added the RangeNumber methods:
each_prime_power(a..b, {...})
,prime_power_count(a..b)
andprime_powers(a..b)
. (2ecf8bb)
Improvements
- Optimized Number
is_omega_prime(n,k)
for largen
andk
. (ac70392) - Optimized Number
is_almost_prime(n,k)
for largen
andk
. (c6188a9) - Optimized Number
nth_composite(n)
for largen
. (8c47ffd, 6c48130) - Extended the Number
.factor
method to accept an optional block. (660429a) - Use
Math::Prime::Util::primes()
in more places whenMath::Prime::Util
is available. (fe757df) - Optimziation in Number
sum_of_squares(n)
: factorizen
only once. (590fc97) - Try to use
Math::Prime::Util
where possible, even when it's an older version. (806e7c0)
Changes
- Changed the order of parameters in Number
smooth_part
andrough_part
methods. (bee1d25) - Number
squfof_factor(n,tries)
now defaults totries=1e4
, when no value is given. (3c831cd) - Modified the result of
Math.gcd_factors(n,arr)
to multiply ton
. (058b71f) - REPL: call
.dump
on the result objects. (fc14efe)
Fixes
- Fixed the Number
lucas_factor(n)
method on 32-bit systems. (b3b21ba) - Fixed some overflow issues on 32-bit systems in
nth_composite(n)
, for largen
. (c8493b8) - Prevent infinite looping in Number
bsearch_inverse
. (e0370a8)
All changes: 22.05...22.07