Converts a value to a boolean.