Use magic number to replace ftol(), minor optimizations.