17 lines
308 B
Plaintext
17 lines
308 B
Plaintext
|
= Bitwise_cast =
|
||
|
|
||
|
This works for C/C++. Basically all you do it cast like this
|
||
|
|
||
|
{{{C
|
||
|
float cast(int foo){
|
||
|
return (* (float*)&foo);
|
||
|
}
|
||
|
}}}
|
||
|
|
||
|
This is also known as the "evil floating point bit level hacking" from the
|
||
|
quake III fast inverse square root.
|
||
|
|
||
|
== Uses ==
|
||
|
|
||
|
* Casting structs for hashing
|