Mail Archives: djgpp/1998/08/22/16:15:24
Stephen Snape wrote:
> yes, sorry, this isn't my actual code, I wrote it in the mail quickly, I
> know I forgot the semis etc. What I am trying to do is find out if a 'bit'
> in a double is ON or OFF and return the value. So I am using the int to
> shift through the double and return the value, but I am getting errors. I
> don't want to use a long because I need 64 bits!
If you want to use a 64-bit integer, then you can use 'long long's. They
work. Bit-shifting a double wouldn't produce the arithmetic results you would
expect. If you do want to quickly multiply (or divide) by powers of 2, then
you can do this:void QuickMultBy2(double& a)
{
*((lword*)&a+1) += 0x100000;
}
--
(\/) Endlisnis (\/)
s257m AT unb DOT ca
Endlisnis AT GeoCities DOT com
Endlis AT nbnet DOT nb DOT ca
- Raw text -