vimwiki/lang/bitwise_cast.wiki
2021-09-22 10:09:42 -04:00

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