Fun with numbers - dammit, but I want a cast!

Erik Max Francis max at alcyone.com
Mon Aug 11 21:32:12 EDT 2003


Carl Banks wrote:

> It seems you didn't read what I wrote carefully.  I was talking about
> C, not C++.  Neither I nor the post I replied to mentioned C++ once.
> I mentioned the C standard several times, never the C++ standard.
> 
> Type casts in C are as I described.

C++ was mentioned by the original poster; either way, C and C++ casts
act precisely the same in this context.  (float) 1 and *(float *) &i
have precisely the same meanings both in C and C++.

-- 
   Erik Max Francis && max at alcyone.com && http://www.alcyone.com/max/
 __ San Jose, CA, USA && 37 20 N 121 53 W && &tSftDotIotE
/  \ If you don't take chances, you can't do anything in life.
\__/  Michael Spinks




More information about the Python-list mailing list