A quick ways to determine the major and minor version numbers of Apex.
And since we're only dealing with integers here, no problems with NLS settings (e.g. invalid number errors when converting '4.2' on a Dutch Apex installation, which expects '4,2').
As a side note: you can get the Apex patch version (if it exists) with a query like this: