The guitar is out of tune when it's tuned (if you see what I mean). Frets provide a 'tempered' tuning that sounds 'good enough' to our ears.
If you go onto the Peterson web site, you will see there are several different piano tunings that can be downloaded... so the piano ain't in tune either!
The mathematics of intervals is very interesting - I'll just go and put my anorak on
