ALBANY, N.Y. (AP) _ A federal judge has thrown out a lawsuit challenging the state prison system's practice of putting two inmates in cells designed for one, saying the double-bunking does not violate the U.S. Constitution.

The lawsuit, first filed in 1995, claimed that the practice violated the ban on cruel and unusual punishment. Inmates at 13 maximum-security prisons argued that they were more likely to be assaulted, faced higher chances of catching a disease and suffered harsh living conditions.

But U.S. District Judge Gerard Lynch, in a decision dated May 26, said that simply putting two convicts in a cell designed for one ``is a far cry from the `wanton and unnecessary infliction of pain' against which the Eighth Amendment protects.''

``Plaintiffs' claims that double-celling subjects them to `the stench of a cell mate's feces and flatulence' ignore the fact that even in a single cell, an inmate would be subjected to the `stench' of his own `feces and flatulence,''' Lynch wrote.

Lynch used basic math _ namely the Pythagorean theorem _ to dispute arguments that those sharing cells were forced to sleep closer to the toilet than prisoners in single-person cells. Most of the cells have between 48 and 60 square feet of space.

Corrections Commissioner Glenn Goord said the case illustrated why inmates ``should not be allowed to tie up our already overburdened judiciary'' with lawsuits.

A spokeswoman for the law firm that represented the inmates said the attorney handling the case was unavailable for comment.

The state in 1995 converted 796 single-inmate cells after county jails complained they were holding convicts who should have been in state custody.