$VersionNumber is a real number which gives the current Mathematica kernel version number, and increases in successive versions.
To find out if you are running under Version 5 or above, you can use the test TrueQ[$VersionNumber >= 5.0].
A version with a particular number is typically derived from the same source code on all computer systems.
See Section 2.14.5.
See also: $ReleaseNumber.
New in Version 2.