Tonelli-Shanks algorithm: Difference between revisions
m
→{{header|Wren}}: Minor tidy
(New post.) |
m (→{{header|Wren}}: Minor tidy) |
||
(2 intermediate revisions by one other user not shown) | |||
Line 1,430:
result = ( result + b ) % modulus;
};
b = ( b
a >>= 1;
}
Line 1,444:
uint64_t result = 1;
while ( exponent > 0 ) {
if ( ( exponent
result = multiply_modulus(result, base, modulus);
}
Line 4,022:
{{libheader|Wren-dynamic}}
{{libheader|Wren-big}}
<syntaxhighlight lang="
import "./big" for BigInt
var Solution = Tuple.create("Solution", ["root1", "root2", "exists"])
|