Is it possible to create a new function from the addition of two other functions in Julia? I want to do something like this:
function quadratic(x)
return x^2
end
function cubic(x)
return x^3
end
f::Function = quadratic + cubic
# such that f(x) returns x^2 + x^3
There is the less magic solution which is f(x) = quadratic(x) + cubic(x)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With