S
S
Sergey2015-10-27 05:33:01
PHP
Sergey, 2015-10-27 05:33:01

How to calculate modulo of large numbers in PHP?

For example 2^52 mod 3^109. Those. so that the calculations take place in full numbers without any e + 52
similarities (1.0144175740568179028790664417177e + 52)
Is this even possible?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Mokhov, 2015-10-27
@goodwin74

bcmod

echo bcmod(bcpow(2, 52), bcpow(3, 109)); // 4503599627370496

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question