←back to thread

631 points wojtczyk | 1 comments | | HN request time: 0s | source
Show context
rgovostes ◴[] No.41410786[source]
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): >>41410865 #>>41411004 #>>41411294 #>>41411316 #>>41412437 #
1. supportengineer ◴[] No.41412437[source]
There must be a way to do a mash-up between a spreadsheet and other languages like FORTRAN. Perhaps the language could be pluggable. You could mix and match and the spreadsheet formulas are the glue. Cell values abstract away the details of how that value got there. But, it accepts a refresh request.