mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Homework Help (https://www.mersenneforum.org/forumdisplay.php?f=78)
-   -   Question about Exponentiation modulaire (https://www.mersenneforum.org/showthread.php?t=24675)

baih 2019-08-07 21:33

Question about Exponentiation modulaire
 
how to calculate pow(2,23571176971393,1523213.17)

I mean
pow(a,e,b)
with b non integer = 123213.17

Have a nice day. :)

lavalamp 2019-08-09 14:21

For the specific case of 1523213.17, you could compute mod 152321317 instead, then once you have that value use it to compute your final [URL="http://www.cplusplus.com/reference/cmath/fmod/"]float mod[/URL].

In general, I suppose it depends on how many decimal digits you have and how much precision you need, but multiplying your modulo by 10^n should work decently well for many inputs.


All times are UTC. The time now is 08:27.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.