Skip to content

Commit

Permalink
Version 23.10
Browse files Browse the repository at this point in the history
  • Loading branch information
trizen committed Oct 17, 2023
1 parent d066781 commit adbff39
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 17 deletions.
12 changes: 7 additions & 5 deletions NUMBER_THEORY_TUTORIAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ In this tutorial we're going to look how we can use [Sidef](https://github.com/t
** ** **** ********* ********* *
```

To get started with Sidef and how to install it, please see [beginner's tutorial](https://codeberg.org/trizen/sidef/src/branch/master/TUTORIAL.md) ([PDF](https://github.com/trizen/sidef/releases/download/23.08/sidef-tutorial.pdf)).
To get started with Sidef and how to install it, please see [beginner's tutorial](https://codeberg.org/trizen/sidef/src/branch/master/TUTORIAL.md) ([PDF](https://github.com/trizen/sidef/releases/download/23.10/sidef-tutorial.pdf)).

Over the years, Sidef incorporated more and more mathematical functions, many of them provided by Dana Jacobsen's excellent [Math::Prime::Util](https://github.com/danaj/Math-Prime-Util) and [Math::Prime::Util::GMP](https://github.com/danaj/Math-Prime-Util-GMP) Perl modules, which provide great performance in tasks involving integer factorization, primality testing and prime counting.

Expand All @@ -30,7 +30,7 @@ After [installing Sidef](https://codeberg.org/trizen/sidef/src/branch/master/TUT

```
$ sidef
Sidef 23.08, running on Linux, using Perl v5.38.0.
Sidef 23.10, running on Linux, using Perl v5.38.0.
Type "help", "copyright" or "license" for more information.
>
```
Expand Down Expand Up @@ -254,7 +254,7 @@ k.powerfree_divisors(n) # k-powerfree divisors of n
k.powerfree_udivisors(n) # k-powerfree unitary divisors of n
```

For the full documentation of each function, please see: [https://metacpan.org/pod/Sidef::Types::Number::Number](https://metacpan.org/pod/Sidef::Types::Number::Number) ([PDF](https://github.com/trizen/sidef/releases/download/23.08/sidef-number-class-documentation.pdf))
For the full documentation of each function, please see: [https://metacpan.org/pod/Sidef::Types::Number::Number](https://metacpan.org/pod/Sidef::Types::Number::Number) ([PDF](https://github.com/trizen/sidef/releases/download/23.10/sidef-number-class-documentation.pdf))

# Generating sequences

Expand Down Expand Up @@ -362,7 +362,7 @@ for n in (0..30) {

This section briefly describes the built-in classes related to computational number theory.

For the documentation of other built-in classes, please see: [https://trizen.gitbook.io/sidef-lang/](https://trizen.gitbook.io/sidef-lang/) ([PDF](https://github.com/trizen/sidef/releases/download/23.08/sidef-book.pdf)).
For the documentation of other built-in classes, please see: [https://trizen.gitbook.io/sidef-lang/](https://trizen.gitbook.io/sidef-lang/) ([PDF](https://github.com/trizen/sidef/releases/download/23.10/sidef-book.pdf)).

## Mod class

Expand Down Expand Up @@ -1600,7 +1600,9 @@ Additionally, the function also calls `special_factor(n)` internally and returns

A massive speed improvement would be using ECM with conjectured bounds to push `B` much higher than we can achieve with trial-division. This would allow us to reject many numbers faster. But that approach would be based on unproved conjectures and therefore is not implemented.

Another conjectured approach would be using Pollard's rho method to find a larger bound for `B`, which requires `O(sqrt(B))` steps to find a prime factor less than `B`. Therefore, if we take `B = 10^12`, after `c*10^6` iterations of the Pollard rho method without success in finding a prime factor of `n`, it's very probable that `n` has no prime factor less than `10^12`. This approach is also not implemented.
Another conjectured approach would be using Pollard's rho method to find a larger bound for `B`, which requires `O(sqrt(B))` steps to find a prime factor less than `B`. Therefore, if we take `B = 10^12`, after `c*10^6` iterations of the Pollard rho method without success in finding a prime factor of `n`, it's very probable that `n` has no prime factor less than `10^12`.

This later approach is implemented by setting `Num!USE_CONJECTURES = true` and is useful for computing upper-bounds, being about 5x faster than the rigorous method.

## Factorization of integers of special form

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ Sidef is a modern, high-level, general-purpose programming language, inspired by

### WWW

* [Beginner's tutorial](https://codeberg.org/trizen/sidef/src/branch/master/TUTORIAL.md) ([PDF](https://github.com/trizen/sidef/releases/download/23.08/sidef-tutorial.pdf))
* [Number theory tutorial](https://codeberg.org/trizen/sidef/src/branch/master/NUMBER_THEORY_TUTORIAL.md) ([PDF](https://github.com/trizen/sidef/releases/download/23.08/sidef-number-theory.pdf))
* [Beginner's tutorial](https://codeberg.org/trizen/sidef/src/branch/master/TUTORIAL.md) ([PDF](https://github.com/trizen/sidef/releases/download/23.10/sidef-tutorial.pdf))
* [Number theory tutorial](https://codeberg.org/trizen/sidef/src/branch/master/NUMBER_THEORY_TUTORIAL.md) ([PDF](https://github.com/trizen/sidef/releases/download/23.10/sidef-number-theory.pdf))
* RosettaCode: https://rosettacode.org/wiki/Sidef
* Gitbook: https://trizen.gitbook.io/sidef-lang/ ([legacy](https://trizen.gitbooks.io/sidef-lang)) ([PDF](https://github.com/trizen/sidef/releases/download/23.08/sidef-book.pdf))
* Gitbook: https://trizen.gitbook.io/sidef-lang/ ([legacy](https://trizen.gitbooks.io/sidef-lang)) ([PDF](https://github.com/trizen/sidef/releases/download/23.10/sidef-book.pdf))

### Q&A

Expand Down
4 changes: 2 additions & 2 deletions TUTORIAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Sidef is a modern, high-level, general-purpose programming language, focusing on

# BOOK

The Sidef Programming Language: [https://trizen.gitbook.io/sidef-lang/](https://trizen.gitbook.io/sidef-lang/) ([legacy](https://trizen.gitbooks.io/sidef-lang)) ([PDF](https://github.com/trizen/sidef/releases/download/23.08/sidef-book.pdf)).
The Sidef Programming Language: [https://trizen.gitbook.io/sidef-lang/](https://trizen.gitbook.io/sidef-lang/) ([legacy](https://trizen.gitbooks.io/sidef-lang)) ([PDF](https://github.com/trizen/sidef/releases/download/23.10/sidef-book.pdf)).

# Installation

Expand All @@ -16,7 +16,7 @@ This section describes how to install Sidef for various operating systems.

For Windows, Sidef is available as a portable 32-bit executable:

* https://github.com/trizen/sidef/releases/download/23.08/sidef-23.08.exe.zip
* https://github.com/trizen/sidef/releases/download/23.10/sidef-23.10.exe.zip

## Linux installation

Expand Down
11 changes: 5 additions & 6 deletions bin/sidef
Original file line number Diff line number Diff line change
Expand Up @@ -405,9 +405,8 @@ HELP

sub create_completion_tree {
scalar {

table => {},
special_key => "\0\0\1\0\0",
special_key => "\0",
};
}

Expand All @@ -418,7 +417,7 @@ sub add_tree_entry {

foreach my $item (@$key) {
$ref = $ref->{$item} //= {};
push @{$ref->{$tree->{special_key}}}, $value;
undef $ref->{$tree->{special_key}}{$value};
}

$tree;
Expand All @@ -438,11 +437,11 @@ sub search_tree {
}
}

@{$ref->{$tree->{special_key}} // []};
sort keys %{$ref->{$tree->{special_key}} // {}};
}

sub add_class_methods_to_completion {
my ($tree, $class) = @_;
my ($tree) = @_;

my $modules_count = scalar(keys %INC);

Expand Down Expand Up @@ -1011,7 +1010,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 23.08, running on Linux, using Perl v5.38.0.
Sidef 23.10, running on Linux, using Perl v5.38.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 = '23.08';
our $VERSION = '23.10';

our $SPACES = 0; # the current number of indentation spaces
our $SPACES_INCR = 4; # the number of indentation spaces
Expand Down

0 comments on commit adbff39

Please sign in to comment.