Got a sadistic sense of humor? While you might get side-eye from colleagues after cracking a joke no one else finds funny, here's the good news. It might be a sign of a higher IQ.

A study conducted by researchers at the Medical University of Vienna studied the role black humor might have in participants' intelligence. They asked 156 adults to rate 12 black-humor cartoons, which touched on themes of death, disease, and disabilities. Participants then completed questions that gauged how well they understood the jokes and if they found them funny. The participants also completed tasks that measured their verbal and nonverbal IQ and answered questions about their mood, aggression levels, and education.

The people with the highest IQs had the highest comprehension and appreciation of the dark cartoons. They were also the most educated. "Humour processing is a complex information-processing task," the study's authors wrote in the scientific journal Cognitive Processing. The researchers concluded that this study could point to "stronger activity in brain areas involved in humour processing." To fully wrap one's head around the punch line of a dark joke requires high-level cognitive brainpower and emotional processing, the researchers said.

The bright side of a dark sense of humor

What's more, the study also found something interesting about the personalities of people who had a twisted sense of humor.

It's often assumed that people who enjoy dark jokes are grumpy and sadistic themselves. This study found that not to be the case. The results revealed quite the opposite. People high on the sick-humor scale were low on the aggression and bad-mood scale. The group of participants who scored the highest on the negative-mood and aggression scale were those who showed only moderate comprehension of the jokes and the lowest level of enjoyment.

The researchers hypothesized why this was the case. To truly appreciate a dark joke, you must be able to see the "playful fiction" of it. And that means you have to be in the right kind of relaxed, playful mood to do so. "Seemingly, only those subjects who have no aggressive feelings towards others as well as no mood disturbance such as dysphoric or depressive mood can afford or get away with the playful exposure in the course of black humour processing," they wrote. Simply put, if you're in a dark mood yourself, you won't find a dark joke as funny.

So the next time you're the only one laughing at your own sick joke, revel in it. You're likely a happier, smarter person because of your twisted sense of humor. The joke's on the people who don't get it.