He went out on his own terms.

Eccentric philanthropist Robert W. Wilson — who leaped to his death from his 16th-floor apartment at the posh San Remo off Central Park West Monday — was just as pragmatic in death as in life.

Even though he had built up a nearly billion-dollar hedge-fund business and then donated hundreds of millions to charity, he still insisted on sharing cabs and splitting the check when dining with friends.

And when he later suffered two strokes, the matter-of-fact mogul, 87, “thought about ways he would [commit suicide]. He was always thinking and analyzing,’’ said a woman who had known him for decades.

“I think he thought this was the least painful way. It seems violent and dramatic, but . . . he ended his life very precipitously with no fanfare.”

Friends said Wilson didn’t even shy away from the subject at a party for his 87th birthday last month.

“His health was failing, and he was ready to go,’’ said pal Stephen Viscusi.

Wilson left behind a brief suicide note — and it was, predictably, to the point, sources added.

“I had a rewarding life. Thank you and goodbye to all my friends. Please make sure you cancel all my plans. Tell everyone what I did. I’m not ashamed of killing myself. Sell all my stuff,” the note read, according to law-enforcement sources.

The colorful do-gooder was openly gay, had no children, and divorced his wife of 35 years, Marillyn, decades ago. She declined comment to Tuesday.

He became renowned for his immense charitable giving, having donated $100 million too each of several of nature-conservancy groups, and millions more to help keep Catholic schools open.

“I’m an atheist, but I think the schools are especially good,’’ the Detroit native told the Financial Times in 2011.

Viscusi and other friends fondly remembered Wilson as “cantankerous” and noted how “frugal” he could be.

“If Robert asked you to dinner, you knew you’d be splitting the check,” Viscusi chuckled.

Neighbor David Tobey said Wilson wouldn’t even splurge on a solo cab ride.

“Robert, for all his money, never took cabs, never took a limo,’’ Tobey said. “He always took the subway. On the few occasions when he did grab a cab, he would usually share a cab with someone in the building. He shared a cab with my wife and insisted that she pay half.”

Wilson started his investment firm, Wilson Associates, with just $15,000 but eventually amassed an $800 million fortune.

Recipients of his $100 million gifts include the World Monuments Fund, the Nature Conservancy, the Environmental Defense Fund and the Wildlife Conservation Society.

Bonnie Burnham, president of the World Monuments Fund, said Wilson was a benefactor for 25 years after getting a simple appeal in the mail.

“Bob Wilson was really a unique character. There was nobody else at all like him. He had a difficult, kind of cantankerous side, but in his heart of hearts, he was a wonderful, generous, kind person who cared about people a lot.’’

Wilson’s anonymous female pal suggested that he jumped into the courtyard of his building to make sure he didn’t land on anyone.

“He would never have put someone else’s life at risk,” she said.

Even the building where he chose to die was clearly part of a meticulous plan.

Wilson had lived in his beloved, art-filled, $20 million-plus apartment overlooking Central Park since 1978, considering it his refuge from a sometimes unfriendly city.

In August 2011, looking out onto the park from the same terrace where he would later jump to his death, he told the Financial Times, “Who needs a summer place? I’ve got one.’’