A community in which webmasters can ask for help with topics such as PHP coding , MySQL , IT jobs, web design, IT security.
Current location:homephp forumphp talk in 2009 yearPHP - Large Integer mod calculation - page 1
User InfoPosts
PHP - Large Integer mod calculation#1
I need to calculate modulus with large number like :


$largenum = 95635000009453274121700;

echo $largenum % 97;


It(s not working... because $largenum is too big for an int in PHP.

Any idea how to do this ?

posted date: 2009-04-17 02:22:00

Re: PHP - Large Integer mod calculation#2
I had made out the solution of this problem. click to view my topic...

hope that hepls.

posted date: 2009-04-17 02:22:01

Re: PHP - Large Integer mod calculation#3
Use bcmod() from BCMath Arbitrary Precision Mathematics:$largenum = (95635000009453274121700(;echo bcmod($largenum, (97();Note, that $largenum is passed as a string, not converted to int.

posted date: 2009-04-17 02:25:00

select page: « 1 »
Copyright ©2008-2017 momige.com, all rights reserved.