math.h: periodic() was bugged

That's, well, awful. Fixed it, and it looks like all postconditions are
satisfied exactly for all practical purposes (though better be safe than
sorry).