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" [...]
Pages
Tags
.net bind9 Books Broken C# C# code comparison Cool criticism Critique csharp Default Development DNS Firefox Functional programming Game GNOME Haskell horrid Java Links Linux massey Mathematics Me Mono music Odd Programming Reference Review self short silly snippet Thought thoughts Types Ubuntu Unicode Unix Work XMLCategories
Archives

An Anachronistic Aphorism
Some programming languages manage to absorb change, but withstand progress. —‘Epigrams in Programming’, Alan J. Perlis, ACM SIGPLAN Sept. 1982