K
Keith Thompson
Keyser Soze said:[...]double uint64;
Just because you name it "uint64" does not make it an integer data type.
The declaration of: "double uint64;" still define a floating point data
type.
If you're using gcc try: "unsigned long long uint64;"
If it's a VC compiler try: "unsigned _int64 uint64;"
unsigned long long is not specific to gcc. It's standard in C99, and
many non-C99 compilers (both C and C++) provide it as an extension.
But the C99 standard says only that long long is *at least* 64 bits;
it can be larger. If you really need a 64-bit unsigned type, use
uint64_t (defined in <stdint.h> in C99), or create your own
system-specific typedef.
But for the OP's problem, this isn't really necessary. Since he's
trying to decompose a double value into bytes, there's not much point
in using an intermediate 64-bit integer. Just transform it to an
array of unsigned char.
That's assume he wants to decompose the *representation* of the double
value; it's not at all clear that that's what he needs to do.
To the original poster: If you want a useful answer, you'll need to
post a followup and clarify the question.
--
Keith Thompson (The_Other_Keith) (e-mail address removed) <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]