Quote Originally Posted by Speedo View Post
If you don't do the cast (either implicitly or explicitly), INT_MAX + 1 is going to overflow and become INT_MIN.... which is definitely not what you want.
Very true. Actually, I will use UINT_MAX, and if I don't cast I will get 0

Quote Originally Posted by Lindley View Post
To a certain extent, you're screwed anyway at that point. The double only has 52 bits of mantissa; once you're dealing with values larger than 2^52, a double can't be accurate to the 1s place anyway.

While it's certainly true that adding small numbers to big ones in floating point is a bad idea, in this *particular* case I'm not sure it's worth worrying about.
Not 100% true. Technically, and double can give the EXACT value of numbers like 2^300, which is exactly what I'm trying to do. However, I get your point.
The way I see it, If my ints are 32 bits, then the double will have enough bits for exact representation.
If my ints are 64 bits, then I'm pretty sure that the +1 will do nothing to the double, but that is okay, because UINT_MAX will be rounded off to UINT_MAX+1 (wich is 2^64), giving me exact values anyways.

Thankyou everyone for your input, I think I found my solution.