Skip to content

Commit

Permalink
Minor simplification in Number __ilog__.
Browse files Browse the repository at this point in the history
  • Loading branch information
trizen committed Aug 3, 2019
1 parent 18155b3 commit ab9ff24
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 1 addition & 3 deletions lib/Sidef/Types/Number/Number.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2565,9 +2565,7 @@ package Sidef::Types::Number::Number {

if ($e > 0) {
state $t = Math::GMPz::Rmpz_init_nobless();
$y == 2
? do { Math::GMPz::Rmpz_set_ui($t, 0); Math::GMPz::Rmpz_setbit($t, $e) }
: Math::GMPz::Rmpz_ui_pow_ui($t, $y, $e);
Math::GMPz::Rmpz_ui_pow_ui($t, $y, $e);
Math::GMPz::Rmpz_cmp($t, $x) > 0 and --$e;
}

Expand Down
8 changes: 8 additions & 0 deletions lib/Sidef/Types/Number/Number.pod
Original file line number Diff line number Diff line change
Expand Up @@ -2088,6 +2088,14 @@ Return the

=cut

=head2 is_power_of

Number.is_power_of() -> I<Obj>

Return the

=cut

=head2 is_prime

Number.is_prime() -> I<Obj>
Expand Down

0 comments on commit ab9ff24

Please sign in to comment.