Guitars are notoriously difficult to tune and to play in tune.
A guitar string has to be some distance off the fingerboard to have enough space to vibrate. But pressing down on the string to fret a note stretches the string, raising the pitch relative to where the fret is placed. Traditionally, steel string guitars compensate for this string stretch by moving the saddle away from the nut a few millimetres relative to the theoretical scale length. The thicker the string the more compensation it needs. This results in flattening the fretted notes closest to the saddle, thus compensating for the string stretch, but doesn't help that much down around the nut end of the fretboard where it is arguably most needed. Many modern luthiers have begun to compensate the nut as well which basically means moving the nut closer to the first fret a roughly equal distance the saddle is moved away. All this can get the intonation of a guitar as close to 'perfect' equal temperament as the human ear can discern. Of course, as discussed in this thread, equal temperament is a compromise that is still 'out of tune' from just intonation but it's the best we can do with straight frets. At least we can now play our guitars in tune with the piano!
Segovia liked to tell a joke to his audiences while tuning up: Guitarists spend half their time tuning and the other half playing out of tune
Being more stretchy than steel, nylon strings are far less susceptible to string stretch intonation problems than steel strings. Thus classical guitars need far less compensation at the saddle (or nut). I don't know how the fret placement on Segovia's famous Hauser guitar was calculated but before the invention of electronic calculators or spreadsheets frets were commonly placed using the so called 'rule of eighteen'. This entails repeatedly dividing the scale length minus the distance from the nut to the previous fret by 18. If you do the math this results in a scale where the 12th fret is not (even theoretically) half way between nut and saddle! But with the right compensation it actually works pretty well. There are other more or less successful 'rules of thumb'.
The correct calculation for equal temperament is the 12th root of 2 which approximates to 17.817. This can be used similarly to the rule of eighteen for a slightly more accurate placement. But of course a modern spreadsheet can calculate the fret positions to micron accuracy and modern CNC can cut them equally well.
One old 1890s parlour guitar I restored had a scale length I couldn't figure out at first. It didn't seem to fit with any common fret placement methods. And then it dawned on me that it was made with two separate scale lengths. The frets were perfectly placed from the sixth to the 20th fret in one scale length and the first to the fifth fret on a slightly shorter scale. This resulted in a nice 'sweetened' tuning for the lower frets every bit as good as 'modern' spreadsheet-driven compensation algorithms. They knew what they were doing those old fellers ... ;-)