As David explained in his answer, Double is not a null type. To assign it a null value, do you have to convert Double to System.Nullable<double> or double?
The full answer would look something like this:
public void MyMethod(double? param = null) { }
The obvious problem here is that instead of just passing the double value, you should pass that double? value instead double? .
I'm not sure about the exact scope of this function, but you can always refer to the default values. For example:
public void MyMethod(double param = double.MinValue) { if (param == double.MinValue) return; }
Or something like that.
Casval Zem Daikun
source share