extension method for determining whether a primitive is true or false