It works on the binary representation so it actually works for any data type, even composite types! It won't resolve pointers/references/aliases of course
Given that rounding tends to be necessary that seems extremely questionable in practice. Similar to how the equality operator in most (probably all) languages can be used with floating point numbers but in most cases that is a very bad idea.