Universal * with any Numeric

assert 2.mul(4) == 8
assert 11.mul(0.1) == 1.1
assert 11.1.mul(0.1) == 1.11
assert 1.1.mul(4) == 4.4

Property definitions

core :: numeric $ Numeric :: mul
	# Universal `*` with any `Numeric`
	#
	# ~~~~
	# assert 2.mul(4) == 8
	# assert 11.mul(0.1) == 1.1
	# assert 11.1.mul(0.1) == 1.11
	# assert 1.1.mul(4) == 4.4
	# ~~~~
	fun mul(other: Numeric): Numeric is abstract
lib/core/numeric.nit:74,2--82,45

core :: numeric $ Float :: mul
	redef fun mul(other) do return self * other.to_f
lib/core/numeric.nit:128,2--49

core :: numeric $ Int :: mul
	redef fun mul(other)
	do
		if other isa Float then
			return to_f * other
		else
			return self * other.as(Int)
		end
	end
lib/core/numeric.nit:104,2--111,4