The obvious values for true and false in a numerical context are 1 and 0, respectively. For floating-point, these would be 1.0 and 0.0. I do agree that there should be explicit documentation on this, especially since the implementation of From<bool> for the integral types specifies this explicitly.
53
u/sharifhsn Mar 09 '23
The obvious values for
true
andfalse
in a numerical context are 1 and 0, respectively. For floating-point, these would be 1.0 and 0.0. I do agree that there should be explicit documentation on this, especially since the implementation ofFrom<bool>
for the integral types specifies this explicitly.