R, 20 bytes
function(a,b)a/(1/b)
in R, a/Inf
is 0
. Moreover, in the R, we can actually see define *
to be this operation instead of .Primitive("*")
which is the standard multiplication operator. The TIO link shows the old and new values and demonstrates that we can use our new *
operator as the infix multiplication operator.
###3 Bytes:
3 Bytes:
%*%
the matrix multiplication operator. Implicitly converts numbers into matrices, so it returns a 1x1
matrix as a result, but that's stored as a length-1 vector in R, just like a single number is.
OR
%o%
Which is an alias for outer(x,y,'*')
which also computes the correct value for numbers.