How many Tyrannosaurus rex have ever walked on Earth? A new study says approximately 2.5 billion. 

According to a study published on Thursday in the journal Science, a team at the University of California, Berkeley calculated how many T. Rex lived over 127,000 generations using calculations focused on body size, sexual maturity, and the creatures' energy needs.

It's a first-of-its-kind figure, but it's just an estimation with a margin of error the size of a T. Rex.

Given the uncertainty in the creatures' generation length, range, and how long they roamed, the Berkeley team estimated that the total population could be as low as 140 million or as high as 42 billion, with 2.4 billion as the mid-value.

The species roamed North America for approximately 1.2 million to 3.6 million years, suggesting that the T. Rex population density was low at any given time. The study said there would be around two in a city the size of Washington, D.C., or 3,800 in California.

"That's a lot of jaws," said the study's lead author, Charles Marshall, director of the University of California Museum of Paleontology. "That's a lot of teeth. That's a lot of claws."

Marshall's team calculated the population density by applying a general biology rule of thumb that states that the larger the species, the less dense its population. Then they calculated how much energy the carnivorous T. rex needed to survive - somewhere between a Komodo dragon and a lion. The more energy required, the less dense the population. 

They also considered that the T .Rex entered sexual maturity between the ages of 14 and 17 and lived for a maximum of 28 years.

More than 40 T. Rex fossils have been discovered since the beast was first identified in 1905, offering a wealth of knowledge about a creature only seen in popular media.

T. Rex fossils have been discovered in the Canadian provinces of Alberta and Saskatchewan, as well as the American states of Montana, Wyoming, South Dakota, North Dakota, Utah, Colorado, New Mexico, and Texas. 

T. Rex died a fiery death when an asteroid crashed into Mexico, annihilating three-quarters of Earth's species.