Is there a function in Julia which takes an array and a scalar as input and returns an array as output where the values of each element of the array are as follows:
out_i = max(input_i, v)
where v is some arbitrary scalar value. (In this case, zero.)
In Python, this function is called maximum (or fmax) which is different from max. It is part of numpy. Example:
In Julia, max is for comparison of two elements and maximum is for the highest value in an iterable. Here, you want comparison between two elements to be broadcasted over every value of your array, so you can do it as follows: