from Kernighan & Pike: High Order Calculator
