-
large numbers
I am sure this has been asked before but I was unable to find it. I am working on a math program and figured hey lets use c++ everything is great until I start programing for factorials. Well in short does anyone know of a library or package for dev C++ or .net that allows me to have integers greater then the oh so high long int. If not does anyone know how to get unsigned int 32 to work with the % fuction. But that still will only cover me for a bit I really could use a library that has all the functions that a long int would have just i need it to float.
Thanks in advance,
starripper
-
If you want really big numbers, use a library
http://www.swox.com/gmp/
BTW, there is no problem with % on any integer types.
-
Thanks for the link I will give this a shot. I think my % not working with unsigned has something to do with my compiler not letting me include system but not to sure.
-
Unless you post your code, and appropriate error messages, sample values, results (expected or otherwise), it's hard to say what's going on.
-
% is a built-in operator, just like +.
Post your code.
-
Maybe you're using % on a floating point type, like this?
Code:
double x = 4, y = x % 3;
If so, you can use the function fmod() instead.