code
23 June 2009 | 0 Comments
Argh #include <stdio.h> #include <math.h> #include <fenv.h> int main () { // don’t set rounding here double ten0 = sin(pow(10.0,22)); fesetround(FE_DOWNWARD); double ten1 = sin(pow(10.0,22)); fesetround(FE_UPWARD); double ten2 = sin(pow(10.0,22)); fesetround(FE_TONEAREST); double ten3 = sin(pow(10.0,22)); fesetround(FE_TOWARDZERO); double ten4 = sin(pow(10.0,22)); printf( "Default: %f\n" "Downward: %f\n" "Upward: %f\n" "ToNearest: %f\n" [...]
Tagged in annoyances, builtins, C, floating-point, GCC, processor
utility
22 June 2009 | 0 Comments
I was looking for some standard symbols to represent the Control key and the Alt key, and couldn’t find one until I came across ISO/IEC 9995-7. Because I had much trouble finding a free copy of the document on the ’Net, I have made a table of the symbols and their functions below. I have [...]
Tagged in 9995, iec, iso, keyboard, Reference, symbols, Unicode
tips
27 May 2009 | 0 Comments
While Googling my way through the interwebs, I came across the 2008 Western Australian Certificate of Education sample examination for Stage 2 Biological Sciences. It contains this diagram: If you’re wondering, the entire hierarchy is drawn from Umberto Eco‘s novel Baudolino.
Tagged in Books, Odd, short, silly, umberto eco
code
27 May 2009 | 0 Comments
This is in reference to the current ‘Twitter image encoding challenge’ running on StackOverflow. If we want to restrict ourselves to assigned, non-control, non-private Unicode characters, then by my reckoning that gives us 129,775 available characters. wget http://unicode.org/Public/UNIDATA/UnicodeData.txt awk -F ‘;’ UnicodeData.txt -f countUnichars.awk | bc countUnichars.awk source: BEGIN { print "ibase=16" } # set [...]
Tagged in awk, code, Programming, silly, stackoverflow, twitter, Unicode