It all adds up.

Who didn’t roll their eyes in math class, thinking that they’d never use this stuff in real life?

Well, it looks like solving equations in school works out to your advantage in the long run, after all.

Ohio State University researchers testing how to help undergrads learn more in a tough statistics course found that not only did they help students ace the class, but the coeds with better math scores also did better on a financial literacy test compared to the control group of students who didn’t improve their math scores.

Researchers also noticed that students with better math literacy, or numeracy, practiced healthier habits, such as having safe sex and not smoking. And some math whizzes appeared more likely to have an emergency fund, but the study said more research is needed to prove the correlation.

“Math isn’t just for people who want a STEM career. It is for all of us,” concluded Ellen Peters, lead author of the study and professor of psychology at Ohio State University. “Knowing how to use numbers is important for everyone, even if you think you’re not using math. Numeracy helps people in their everyday lives.”

Number nerds are taking their know-how to the bank. A 2014 study found that while math scores, college education, sports and leadership roles were all associated with higher earnings over a 20-year period, those who were good at math as well as social skills earned most of all. That same year, a Department of Education Report found that college grads with STEM-related degrees earn an average of $65,000 – and their non-STEM coeds make about $15,500 less.

And advancing past Algebra II in high school also correlates with graduating high school, earning a college degree and succeeding in the workforce.

But what’s more surprising is how math skills are linked with personal health. Peters ran a previous study that found the decision-making of breast cancer patients actually suffered when they were not good at math. They made more emotional decisions about their treatment, and were swayed by the way doctors presented information to them, rather than looking at information itself, such as survival rates. And that backs research that has found people who are less comfortable with numbers suffer worse health outcomes. Diabetics with lower numeracy scores have higher blood sugar levels, for example.