C version of "baking pi"