2
Galera is the following to tried makes power followed by modulation -> mod, but the function Pow() returns "INF" and the other functions like bcpow and bcpowmod return as non-existent functions within the class. The version of mine: PHP7.
$m = 726;
$d = 71;
$n = 1073;
$c = pow($m,$d) % $n // INF
$c = bcpow($m,$d) % $n; // Fatal error: undefined function bcpow()...
$c = bcpowmod($m,$d,$n); // Fatal error: undefined function bcpowmod()...
Does anyone know why?
You’re missing a period and a comma on the fourth line. See here which is working: http://sandbox.onlinephpfunctions.com/code/fd75850c5babf53f4dd9701bee9d9bc9276fd7
– Douglas
In the sandbox:
pow() // retorna zero
bcpow // retorna 301
bcpowmod // retorna 436 correto.
Mas na minha class:
pow() // INF
bcpow()// undefined
bcpowmod // undefined
– ayelsew
Probably the
bcmath
is not installed. Aphpinfo();
is enough to check these things. As for thepow
, is normal, after all the numbers you used exceed the storage capacity.– Bacco
Success! Thank you very much.
– ayelsew