![]() |
||
|---|---|---|
Links
Home · |
Logical or Boolean functionsThe calculator has three logical functions: and, or and exclusive-or (xor) built in. These calculate values bitwise, almost literally comparing the ieee-754 representations of numbers bit by bit. These operations act on binary representations of numbers, where the bits are the binary digits. They only really make sense if you are using binary, octal or hexadecimal representation of a number and so they are not available (directly) for decimals. They also don’t make much sense for anything other than nonnegative integers, but since the functions can be defined consistently for any complex number, they are. The and functionThis function (and button, ‘&’ key) computes the bitwise and of two numbers: for digits d and f, d and f = 1 whenever d = f = 1. So for example, in binary, 10101010 and 00111100 = 00101000. The or functionThis function (or button, ‘|’ key) computes the bitwise inclusive or (Latin vel) of two numbers: for digits d and f, d or f = 1 whenever d = 1 or f = 1. So for example, in binary, 10101010 and 00111100 = 10111110. The xor functionThis function (xor button, ‘X’ key) computes the bitwise exclusive or (Latin aut) of two numbers: for digits d and f, d xor f = 1 whenever d ≠ f. So for example, in binary, 10101010 and 00111100 = 10010110. Other logical functionsThe unary logical functions not and bitwise complement are not implemented because I haven’t found an unambiguous way to decide what they mean when applied to a complex number in ieee-754 representation. Last modified: Sat 31 May 2008 01:10 pm |
|