Another way to express this is that the just fifth has a frequency ratio (compared to the tonic) of 3:2 or 1.5 to 1, whereas the seventh semitone (based on 12 equal logarithmic divisions of an octave) is the seventh power of the twelfth root of two or 1.4983... to 1, which is not quite the same (out by about 0.1%). Take the just fifth to the twelfth power, then subtract seven octaves, and you get the Pythagorean comma (about 1.4% difference).