diff --git a/floatswap.h b/floatswap.h new file mode 100644 --- /dev/null +++ b/floatswap.h @@ -0,0 +1,14 @@ +#include +#include + +template <> inline float qbswap(float source) +{ + float result; + char* s = (char*) &source; + char* t = (char*) &result; + t[0] = s[3]; + t[1] = s[2]; + t[2] = s[1]; + t[3] = s[0]; + return result; +}