The Clinton administration's decision to close the federal government Wednesday in honor of Richard M. Nixon will cost taxpayers millions of dollars, but it follows the precedent of at least the past four presidential funerals.

Administration officials yesterday said the government was shut down for the funerals of John F. Kennedy, Dwight D. Eisenhower, Harry S. Truman and Lyndon B. Johnson, citing those closings as the basis for President Clinton's decision to do the same for the Nixon funeral.

How much such a closing will cost was not clear, but Janice Lachance, a spokeswoman for the Office of Personnel Management, said essential workers who are required to work Wednesday will receive a total of $23 million in added pay. They are entitled to the extra compensation because Wednesday will be considered a federal holiday for pay purposes.

During the winter storms that hit Washington earlier this year, officials cited a figure of about $60 million as the cost of closing the federal bureaucracy here. A 1982 study by the House Post Office and Civil Service human resources subcommittee put the cost of a one-day closing ordered by President Ronald Reagan during a budget crisis at $82 million to $88 million, well above the $33 million price tag that the General Accounting Office placed on a 1986 furlough.

Asked whether the administration engaged in any debate over whether to shut down the federal government, White House press secretary Dee Dee Myers said, "The decision was made by the president based on tradition. The president agreed that it would be appropriate."

Postal Service spokesman Frank Brennan said yesterday that large post offices will offer limited retail service Wednesday, but mail will not be delivered to residential or business addresses. The policy follows what the agency did on the days of previous presidential funerals.

Clinton's order does not affect either the legislative or judicial branches. Congress will be in recess; the Supreme Court will close, as will most other federal courts.

Although the Nixon funeral is being held in California, a number of task forces were at work in Washington yesterday on arrangements for the ceremony. The Military District of Washington, an Army command, was making arrangements for the military aspects of the funeral and a State Department task force was handling the visits of foreign officials.

Russian Deputy Prime Minister Alexander Shokhin will represent Boris Yeltsin, while former prime minister Edward Heath will represent the government of Britain. Former prime minister Morihiro Hosokawa of Japan and former president Chaim Herzog of Israel will attend, the White House said.

Several planes in the Air Force One fleet will carry mourners to California, Myers said. Former presidents Gerald R. Ford, Jimmy Carter, George Bush and Reagan declined the White House invitation to accompany Clinton and will arrive on their own. Former Nixon Cabinet members will take the Air Force One backup plane.

Nixon's body will be returned to California aboard another Air Force plane, which carried the body of his wife, Pat, to California for services last year. An Air Force official told the Associated Press that the plane is the one Nixon used as his primary plane while in office. A fourth plane, from Washington, will include a large congressional delegation.

The White House said the service will last about an hour and that two private receptions, for family and friends and for foreign dignitaries, will be held. All living former secretaries of state have been invited.