Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ Divide() [2/2]

static BinaryExpression System.Linq.Expressions.Expression< TDelegate >.Divide ( Expression< TDelegate > left,
Expression< TDelegate > right,
MethodInfo? method )
inlinestaticinherited

Definition at line 1552 of file Expression.cs.

1553 {
1554 ExpressionUtils.RequiresCanRead(left, "left");
1555 ExpressionUtils.RequiresCanRead(right, "right");
1556 if (method == null)
1557 {
1558 if (left.Type == right.Type && left.Type.IsArithmetic())
1559 {
1560 return new SimpleBinaryExpression(ExpressionType.Divide, left, right, left.Type);
1561 }
1562 return GetUserDefinedBinaryOperatorOrThrow(ExpressionType.Divide, "op_Division", left, right, liftToNull: true);
1563 }
1564 return GetMethodBasedBinaryOperator(ExpressionType.Divide, left, right, method, liftToNull: true);
1565 }
static void RequiresCanRead(Expression expression, string paramName)
static BinaryExpression GetMethodBasedBinaryOperator(ExpressionType binaryType, Expression left, Expression right, MethodInfo method, bool liftToNull)
static BinaryExpression GetUserDefinedBinaryOperatorOrThrow(ExpressionType binaryType, string name, Expression left, Expression right, bool liftToNull)

References System.Linq.Expressions.Expression< TDelegate >.GetMethodBasedBinaryOperator(), System.Linq.Expressions.Expression< TDelegate >.GetUserDefinedBinaryOperatorOrThrow(), and System.Dynamic.Utils.ExpressionUtils.RequiresCanRead().