BindRound method binds nullable double as decimal.
```
private Expression BindRound(SingleValueFunctionCallNode node)
{
Contract.Assert("round" == node.Name);
Expression[] arguments = BindArguments(node.Parameters);
Contract.Assert(arguments.Length == 1 && IsDoubleOrDecimal(arguments[0].Type));
MethodInfo round = arguments[0].Type == typeof(double) ? ClrCanonicalFunctions.RoundOfDouble : ClrCanonicalFunctions.RoundOfDecimal;
return MakeFunctionCall(round, arguments);
}
```
Comments: This does not seem to work. Msdn's example compares a variable to a type using "is". However, here we compare 2 types. ``` int? i = 5; if (i is int) // true ``` A solution is: ``` MethodInfo round = IsType<double>(arguments[0]) ? ClrCanonicalFunctions.RoundOfDouble : ClrCanonicalFunctions.RoundOfDecimal; ```
```
private Expression BindRound(SingleValueFunctionCallNode node)
{
Contract.Assert("round" == node.Name);
Expression[] arguments = BindArguments(node.Parameters);
Contract.Assert(arguments.Length == 1 && IsDoubleOrDecimal(arguments[0].Type));
MethodInfo round = arguments[0].Type == typeof(double) ? ClrCanonicalFunctions.RoundOfDouble : ClrCanonicalFunctions.RoundOfDecimal;
return MakeFunctionCall(round, arguments);
}
```
Comments: This does not seem to work. Msdn's example compares a variable to a type using "is". However, here we compare 2 types. ``` int? i = 5; if (i is int) // true ``` A solution is: ``` MethodInfo round = IsType<double>(arguments[0]) ? ClrCanonicalFunctions.RoundOfDouble : ClrCanonicalFunctions.RoundOfDecimal; ```