Quadratic calculator using error handling