I want to set a `float` value to `1.0` if one vector equals another, and `0.0` if the vectors are not equal

```
if( v1 == v2 )  floatVal = 1.0 ;
else  floatVal = 0.0 ;

```

But wouldn't it be "faster" or an optimization just to set 

```
floatVal = (v1 == v2) ;

```

But it doesn't work. You can't implicitly (or explicitly) convert float to bool? Is there a way to do this or do I have to use the `if` statement branch?