Approximately, we can use the ideal gas law, below we see how we can deduce the density from general gas equation. To do this, remember that the number of moles n is equal to , where m is the mass and M the molar mass of the gas, and the density is .