How can I calculate it in C?
20X(77^2) mod 119
It's too big... even can't use pow/%/mod.....
thx!!
Printable View
How can I calculate it in C?
20X(77^2) mod 119
It's too big... even can't use pow/%/mod.....
thx!!
Sorry... I posted wrongly... it should be in C Programming section...
Pls del it..... sorry.....
20(77*77) is about 118000 which is too big for an int but should work OK for a long.
You could try decreasing the result by a factor of ten to get it into the range of int, Do your modulo, then multiple the result by a random number between 1 and 10 to get it back up to a higher value if you want.
Quote:
Originally posted by Unregistered
20(77*77) is about 118000 which is too big for an int but should work OK for a long.
You could try decreasing the result by a factor of ten to get it into the range of int, Do your modulo, then multiple the result by a random number between 1 and 10 to get it back up to a higher value if you want.
thx a lot!!! :D