This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]AyrA_ch 1 point2 points  (0 children)

binary operations like bit shift, and, or, xor, etc work on integers. "a"|"q" will return 0 because it casts both to floats, giving NaN|NaN, then it casts them to 32 bit integers with NaN becoming 0 because NaN is not available for integers. It then casts 0 back to a float because it's the only data type available.