When I try to make an implicit cast from a double to an unsigned long, I have an overflow warning : "warning: overflow in implicit constant conversion [-Woverflow]".
Here is the instruction :
unsigned long ulongMax = pow(2.0, 64.0) - 1;
But when I explicitly cast this like below, it's ok !
unsigned long ulongMax = (unsigned long) (pow(2.0, 64.0) - 1);
I don't understand why i have a warning, the result (18446744073709551615) is the same than ULONG_MAX
from the header "limits.h".