Half of all women working in science, technology, engineering and math have experienced gender discrimination at work, according to a new study released the day after a disgraced Google engineer filed a lawsuit claiming white conservative men are the true victims of Silicon Valley.

James Damore was fired from Google after writing a 10-page memo citing women's "neuroticism" as a reason there are fewer female workers in high-stress jobs at the search giant. The lawsuit he filed Monday argues that Google was so overly concerned with filling gender and racial quotas that it was hurting male employees as well as potential male employees.

But a study out on Tuesday from the Pew Research Center, which polled more than 4,900 workers in the U.S., found that in the traditionally male-dominated fields of science, technology, engineering and math (STEM), only 19 percent of men said they had experienced gender discrimination at work, versus 50 percent of women.

Get breaking news and insider analysis on the rapidly changing world of media and technology right to your inbox. This site is protected by recaptcha

In certain STEM subsets, the proportion of women reporting discrimination was even higher: 78 percent of those who work in majority-male workplaces reported gender discrimination, followed by 74 percent of those working in computer jobs.

Even outside of STEM, the numbers were high, with 41 percent of women in non-STEM jobs saying they've dealt with discrimination, the Pew study found.

"The challenges that women in STEM face often echo the challenges of all working women," said Cary Funk, lead author of the report and Pew's director of science and society research. "What the study does is take a broad-based look at the issues facing the STEM workforce. I think they really speak to the complex issues surrounding diversity in the workplace."

The Pew study, which was conducted last July and August, before Hollywood's sexual misconduct scandal led to a national reckoning, also polled women on sexual harassment. Both groups were equally likely to say they had experienced sexual harassment at work — 22 percent.

Both groups were less likely than their male counterparts to think that women are "usually treated fairly" when it comes to opportunities for promotion and advancement.

Damore's viewpoint, both in and outside of Google, is disputed. Google faces a separate suit filed by three women who allege the company pays women less than men for similar work and gives them less opportunity for promotions, bonuses and raises — a claim Google denies.

Stephanie Newby, the CEO of Crimson Hexagon, an artificial intelligence company that provides consumer insights based on publicly available data, said she was "not at all surprised" by Pew's findings.

In 2004, Newby founded Golden Seeds, an investment firm that provides capital to women-led businesses. At Crimson Hexagon, she said she has made a point of hiring and promoting qualified female candidates after seeing first-hand the challenges that women entrepreneurs and women in male-oriented jobs face.

"We need environments where women can thrive, not be cornered about how they look or have to think about the kinds of things that make them worry about being different or trying to prove themselves, because so much energy can be expended on that instead of getting the job done," she said. "I think it provides a competitive advantage for us that we have women in senior positions."