Hullaballoonatic
12/01/2019, 1:52 AMoperator fun Vector.times(scalar: Double) = mapToVector(scalar::times)
but since division isn't commutative, i can't use the same syntax for that, unless there's a way I don't know of?
operator fun Vector.div(divisor: Double) = mapToVector { it / divisor }
Dico
12/01/2019, 7:36 AMdivisor
as a second parameter to mapToVector and expect a lambda that takes 2 doubles, the second one being the divisor. Then you can pass Double::div.