The end of the year is a traditional time for lists and I thought I’d do a post just to summarize the most interesting or surprising things that I discovered while writing this blog during 2012.
While doing research for blog posts, or getting feedback on posts, or from comments on posts, I sometimes end up learning unexpected things about the topic about which I am writing. These aren’t necessarily the most useful things to be found in my blog posts, but they entertained me, and I hope they entertain the readers. Here they are, in date order, the top eight of 2012:
- It is well known that the transcendental number pi cannot be accurately represented as a double-precision number. What’s less well known is that the error in double(pi) can be measured extremely accurately with sin(double(pi)).
- It can take 112 digits to precisely print the mantissa of a 32-bit float.
- std::async is surprisingly easy to use.
- Intermediate float precision is far less well defined than I thought.
- In some situations Windows silently ignore application crashes and let the process keep on running!
- I found out that my backup drive was triggering a 4 GB allocation. The bug was then fixed.
- While the x86 assembly language integer instructions sub and add are virtually identical, in some cases sub can be three or even four times faster than add.