Closed KN4CK3R closed 1 week ago
The docs of add tell us
add
If one of the numbers is a float, the result is a float.
float
which is not true if two zeros are added because internally != 0 is used as implicit type check. So add (0 | float) (0 | float) returns an int zero.
!= 0
add (0 | float) (0 | float)
This PR remembers the input types and uses the correct type for the return value.
All committers have signed the CLA.
The docs of
add
tell uswhich is not true if two zeros are added because internally
!= 0
is used as implicit type check. Soadd (0 | float) (0 | float)
returns an int zero.This PR remembers the input types and uses the correct type for the return value.