That relies on assumptions (ideal gas, adiabatic compression) that might break down for supersonic jets, but it's pretty close for the speed of sound.