//function being called is defined as void DoSomething( double x ) double? myValue; if( null != myValue ) { DoSomething( (double)myValue ); }If you have a nullable value type like double? or int?, and want nulls to become a value in the equivalent non-nullable type, there is a shorthand you may come across:
double? myNullableValue; double myNonnullValue; myNonnullValue = myNullableValue ?? 0; // is equivalent to: myNonnullValue = (myNullableValue!=null) ? (double)myNullableValue : 0; // which is of course equivalent to if(myNullableValue!=null) { myNonnullValue = (double)myNullableValue; } else { myNonnullValue = 0; }I wish the ?? syntax worked with strings, eg sValue??"None", but strings are objects, and it doesn't.