Translating...

This commit is contained in:
danogentili 2016-06-25 00:01:38 +02:00
parent 6399888253
commit 407ca2286b
2 changed files with 4 additions and 7 deletions

View File

@ -18,7 +18,7 @@ class TelepyShell extends Cmd {
} }
return array_slice($line, null, $blank_pos)->lower() . ' ' . array_slice($line, ($blank_pos + 1), null); return array_slice($line, null, $blank_pos)->lower() . ' ' . array_slice($line, ($blank_pos + 1), null);
} }
function completedefault( . . . $ignored) { function completedefault(...$ignored) {
pyjslib_printnl($ignored); pyjslib_printnl($ignored);
} }
function complete($text, $state) { function complete($text, $state) {

View File

@ -43,8 +43,7 @@ function isprime($n, $precision = 7) {
$d = ($n - 1); $d = ($n - 1);
$s = 0; $s = 0;
while ((($d % 2) == 0)) { while ((($d % 2) == 0)) {
$d $d = floor($d /2);
//= 2;
$s+= 1; $s+= 1;
} }
foreach (pyjslib_range($precision) as $repeat) { foreach (pyjslib_range($precision) as $repeat) {
@ -112,8 +111,7 @@ function primefactors($n, $sort = false) {
} }
while ((($n % $checker) == 0)) { while ((($n % $checker) == 0)) {
$factors[] = $checker; $factors[] = $checker;
$n $n = floor($n / $checker);
//= $checker;
$limit = (pyjslib_int(pow($n, 0.5)) + 1); $limit = (pyjslib_int(pow($n, 0.5)) + 1);
if (($checker > $limit)) { if (($checker > $limit)) {
break; break;
@ -130,8 +128,7 @@ function primefactors($n, $sort = false) {
} }
$factor = pollard_brent($n); $factor = pollard_brent($n);
$factors->extend(primefactors($factor)); $factors->extend(primefactors($factor));
$n $n = floor($n / $factor);
//= $factor;
} }
if ($sort) { if ($sort) {