The Supreme Court, breaking into unusual alliances, ruled Tuesday that federal judges, on their own initiative, can correct a state’s error in math and dismiss an inmate’s appeal that misses a filing deadline.

By a 5-4 vote, justices dealt a defeat to Florida inmate Patrick Day, who missed the deadline for seeking federal court review of his state second-degree murder conviction by three weeks.