Thanks! I need to remind myself things can be added by anything in Swift and look for its implementation source.
I was just trying to verify what .scale(by:) is just multiply, and it appears to be the case. Wonder what's the rationale for adding this, instead of simply just do x *= s. Maybe just to satisfy some mathematician's notion of what multiply mean?
Maybe just to satisfy some mathematician's notion of what multiply mean?
Just the opposite!
It comes from the VectorArithmetic protocol in SwiftUI; if it were just a concrete method on Double, they would use *=, but there are some drawbacks to following that approach with more general types (mostly around limitations of the current type inference system).