Defining a function that modifies its argument in place defines a new function instead

That’s probably related to some previous definition of F in your section. Maybe you can get rid of it by restarting Julia.

If the output is a scalar, you cannot modify it “in place”, because it is immutable. Instead, you have to reassign the value bound to F:

julia> F = 0.0
0.0

julia> F = foo!(F, 0.105)
-0.02027417507189877

julia> F
-0.02027417507189877
1 Like