Temperament is a system of musical tuning. It is impossible to tune the 12 half-steps of the chromatic scale so that all the intervals are mathematically perfect, so compromises have to be made to achieve the best fit. The system used today is known as equal temperament, or even temperament, in which all half-steps are equal. This results in all intervals being slightly out of tune but enables total access to all keys. Compare with just intonation.
Earlier systems of temperament include Pythagorean tuning, in which the perfect fifths were made pure; this resulted in sharp-key intervals being good (e.g. D-F♯-A) but flat-key intervals being out of tune (e.g., D♭-F-A♭).