Well yeah, but it sounds like what was wrong was the level of precision used. It's not always possible to work around numerical issues arising from finite precision.