Compensating or correcting for variations in pressure, density or temperature of gases to be measured {using electrical means involving digital counting}