You didn't win the big Mega Millions jackpot on Tuesday.  But like most lottery winners, it probably would have ruined your life anyway.  Not this guy though.

Last May, a 64-year-old from Calgary named Tom Crist was golfing in Palm Springs when he got a phone call from lottery officials in Canada . . . telling him he'd won $40 MILLION.  (That's about $37.5 million U.S.)

And he didn't tell anyone about it . . . including his kids . . . until this past Monday, when lottery rules stipulated that he had to go in and have his photo taken.

But he wasn't keeping it a secret so he could hoard it all for HIMSELF.  It turns out Tom is retired and pretty well off.  So he doesn't really NEED the money.  And instead of keeping it, he's donating all of it to CHARITY.

Tom lost his wife of 33 years to cancer in 2012, and says he knew what to do with the money as soon as he got the call.

Getty Images

For now, he's putting it all in a trust fund, so he and his kids can handpick charities to give it to.  But he says a large chunk of it will go to help fund cancer research.  And on Tuesday, he donated $1.2 million to a local cancer center in Calgary.