Code to determine WP version check

get_bloginfo( 'version' )

Other version globals can be found in wp-includes/version.php

Also, it’s safer to use PHP’s version_compare().