Question: In our implementation of the scale function (page 25), the body of the loop executes the command data[j] *= factor. We have discussed that numeric
In our implementation of the scale function (page 25), the body of the loop executes the command data[j] *= factor. We have discussed that numeric types are immutable, and that use of the *= operator in this context causes the creation of a new instance (not the mutation of an existing instance). How is it still possible, then, that our implementation of scale changes the actual parameter sent by the caller?
Step by Step Solution
3.30 Rating (165 Votes )
There are 3 Steps involved in it
Think abo... View full answer
Get step-by-step solutions from verified subject matter experts
