vimwiki/lang/bitwise_cast.wiki

17 lines
308 B
Plaintext
Raw Normal View History

2021-09-22 14:09:42 +00:00
= 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