top | item 32494296 (no title) brospars | 3 years ago There is something wrong with the order of operations. When I type 2+2*2-6 i get -6 which should be 0. discuss order hn newest sneak|3 years ago I would think this might be the first unit test one would write for a calculator program. unknown|3 years ago [deleted] simonz05|3 years ago Yep, this should be evaluated as `(- (+ 2 (* 2 2)) 6)` unsafecast|3 years ago It looks like APL order? Right-to-left. JackFr|3 years ago No. It’s not right to left. It’s just weird: 3 ^ 1 * 2 6 3 ^ 1 / 2 1.73205 3 ^ 1 + 2 5 3 ^ 1 - 2 1 load replies (1) bdwjn|3 years ago Oh there's more:9 - 3 ^ 2 = 09 -3 ^ 2 = 18 ???pi = 3.14159265362 pi = 5.1415926536 ???sin(3.1415926536 radians) = -0sin(pi radians) = Incompatible units ??? wizofaus|3 years ago Seems to assume + if an arithmetic operator is missing? load replies (1)
sneak|3 years ago I would think this might be the first unit test one would write for a calculator program.
unsafecast|3 years ago It looks like APL order? Right-to-left. JackFr|3 years ago No. It’s not right to left. It’s just weird: 3 ^ 1 * 2 6 3 ^ 1 / 2 1.73205 3 ^ 1 + 2 5 3 ^ 1 - 2 1 load replies (1)
JackFr|3 years ago No. It’s not right to left. It’s just weird: 3 ^ 1 * 2 6 3 ^ 1 / 2 1.73205 3 ^ 1 + 2 5 3 ^ 1 - 2 1 load replies (1)
bdwjn|3 years ago Oh there's more:9 - 3 ^ 2 = 09 -3 ^ 2 = 18 ???pi = 3.14159265362 pi = 5.1415926536 ???sin(3.1415926536 radians) = -0sin(pi radians) = Incompatible units ??? wizofaus|3 years ago Seems to assume + if an arithmetic operator is missing? load replies (1)
sneak|3 years ago
unknown|3 years ago
[deleted]
simonz05|3 years ago
unsafecast|3 years ago
JackFr|3 years ago
bdwjn|3 years ago
9 - 3 ^ 2 = 0
9 -3 ^ 2 = 18 ???
pi = 3.1415926536
2 pi = 5.1415926536 ???
sin(3.1415926536 radians) = -0
sin(pi radians) = Incompatible units ???
wizofaus|3 years ago