camelCase
The Case of the Mysterious Camel.
- Reaction score
- 362
I was bored and decided to look through limits.h
I saw a few weird things like how ULLONG_MAX is supposed to be 2^64 but ended up becoming (2^64)-1 in the "Locals" window when debugging.
And how converting the max value of a float to a Uint64 is (2^63)
Guess I was messing around because I never understood the max value of a float compared to that of an Uint64.
I was trying to figure out which had the higher value =x
I'm guessing float > Uint64.
What's really weird, to me, is that the max value of a Uint64 is (2^64)-1.
I saw a few weird things like how ULLONG_MAX is supposed to be 2^64 but ended up becoming (2^64)-1 in the "Locals" window when debugging.
And how converting the max value of a float to a Uint64 is (2^63)
Code:
unsigned long long ull = ULLONG_MAX; //18446744073709551615 = (2^64)-1
float f = FLT_MAX; //???
float ull_f = static_cast<float>(ull); //Not enough precision to represent correctly
unsigned long long f_ull = static_cast<unsigned long long>(f); //2^63
Guess I was messing around because I never understood the max value of a float compared to that of an Uint64.
I was trying to figure out which had the higher value =x
I'm guessing float > Uint64.
What's really weird, to me, is that the max value of a Uint64 is (2^64)-1.