Know whether the version of the device is greater than a specific version

there any way to know whether the version of the device is greater than a specific version , such as 5.0 ?