A friend doing homework for a university assignment, circa Leopard or Snow Leopard, noticed that Calculator produced negative values when raising a negative number to an even power.
The bug turned out to be in CFNumber, in Core Foundation. CFNumber does a lot of fiddly stuff at the bit level for performance, and one of their optimizations for exponentiation was incorrect. Somehow it was never found by tests or due to buggy behaviors it created in other apps, but by someone clicking buttons and thinking critically about the output.
replies(5):