I would like to create a function that takes a numerical value and has a default value. For instance, I can define
f[x_:10] := 2 * x
And this works. If I would like to check whether the x is a numeric value, I can write this as
f[x_?NumericQ] = 2 * x
But if I try to do both, that is check whether it is numeric and it has default value, the function does not work. In other words, the following expression is not correct
Tarkeshwar is looking for a way to specify that the argument is numeric and that it has a default value if no value is passed. David’s answer does that.