Skip to content

Commit

Permalink
Added several aliases for trigonometric functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
trizen committed Jan 21, 2024
1 parent ef17845 commit 4aa0032
Showing 1 changed file with 29 additions and 2 deletions.
31 changes: 29 additions & 2 deletions lib/Sidef/Types/Number/Number.pm
Original file line number Diff line number Diff line change
Expand Up @@ -5011,6 +5011,8 @@ package Sidef::Types::Number::Number {
bless \__asin__(_any2mpfr_mpc($$x));
}

*arcsin = \&asin;

sub __asinh__ {
my ($x) = @_;
goto(ref($x) =~ tr/:/_/rs);
Expand All @@ -5033,6 +5035,8 @@ package Sidef::Types::Number::Number {
bless \__asinh__(_any2mpfr_mpc($$x));
}

*arcsinh = \&asinh;

#
## cos / cosh / acos / acosh
#
Expand Down Expand Up @@ -5112,6 +5116,8 @@ package Sidef::Types::Number::Number {
bless \__acos__(_any2mpfr_mpc($$x));
}

*arccos = \&acos;

sub __acosh__ {
my ($x) = @_;
goto(ref($x) =~ tr/:/_/rs);
Expand Down Expand Up @@ -5142,6 +5148,8 @@ package Sidef::Types::Number::Number {
bless \__acosh__(_any2mpfr_mpc($$x));
}

*arccosh = \&acosh;

#
## tan / tanh / atan / atanh
#
Expand Down Expand Up @@ -5212,6 +5220,8 @@ package Sidef::Types::Number::Number {
bless \__atan__(_any2mpfr_mpc($$x));
}

*arctan = \&atan;

sub __atanh__ {
my ($x) = @_;
goto(ref($x) =~ tr/:/_/rs);
Expand Down Expand Up @@ -5243,6 +5253,8 @@ package Sidef::Types::Number::Number {
bless \__atanh__(_any2mpfr_mpc($$x));
}

*arctanh = \&atanh;

sub __atan2__ {
my ($x, $y) = @_;
goto(join('__', ref($x), ref($y)) =~ tr/:/_/rs);
Expand Down Expand Up @@ -5380,6 +5392,8 @@ package Sidef::Types::Number::Number {
bless \__asec__(_any2mpfr_mpc($$x));
}

*arcsec = \&asec;

sub __asech__ {
my ($x) = @_;
goto(ref($x) =~ tr/:/_/rs);
Expand Down Expand Up @@ -5414,6 +5428,8 @@ package Sidef::Types::Number::Number {
bless \__asech__(_any2mpfr_mpc($$x));
}

*arcsech = \&asech;

#
## csc / csch / acsc / acsch
#
Expand Down Expand Up @@ -5500,6 +5516,8 @@ package Sidef::Types::Number::Number {
bless \__acsc__(_any2mpfr_mpc($$x));
}

*arccsc = \&acsc;

sub __acsch__ {
my ($x) = @_;
goto(ref($x) =~ tr/:/_/rs);
Expand All @@ -5526,6 +5544,8 @@ package Sidef::Types::Number::Number {
bless \__acsch__(_any2mpfr_mpc($$x));
}

*arccsch = \&acsch;

#
## cot / coth / acot / acoth
#
Expand Down Expand Up @@ -5604,6 +5624,8 @@ package Sidef::Types::Number::Number {
bless \__acot__(_any2mpfr_mpc($$x));
}

*arccot = \&acot;

sub __acoth__ {
my ($x) = @_;
goto(ref($x) =~ tr/:/_/rs);
Expand Down Expand Up @@ -5638,6 +5660,8 @@ package Sidef::Types::Number::Number {
bless \__acoth__(_any2mpfr_mpc($$x));
}

*arccoth = \&acoth;

sub __cis__ {
my ($x) = @_;
goto(ref($x) =~ tr/:/_/rs);
Expand Down Expand Up @@ -6195,6 +6219,7 @@ package Sidef::Types::Number::Number {
*bern = \&bernfrac;
*bernoulli = \&bernfrac;
*Bernoulli = \&bernfrac;
*BernoulliB = \&bernfrac;
*bernoulli_number = \&bernfrac;

sub faulhaber_polynomial {
Expand Down Expand Up @@ -20764,9 +20789,11 @@ package Sidef::Types::Number::Number {
(HAS_PRIME_UTIL ? Math::Prime::Util::gcd($n, $base) : Math::Prime::Util::GMP::gcd($n, $base)) == 1
|| return Sidef::Types::Bool::Bool::FALSE;

((HAS_PRIME_UTIL and $base < ULONG_MAX)
(
(HAS_PRIME_UTIL and $base < ULONG_MAX)
? Math::Prime::Util::is_strong_pseudoprime($n, $base)
: Math::Prime::Util::GMP::is_strong_pseudoprime($n, $base))
: Math::Prime::Util::GMP::is_strong_pseudoprime($n, $base)
)
|| return Sidef::Types::Bool::Bool::FALSE;
}

Expand Down

0 comments on commit 4aa0032

Please sign in to comment.