public static AbstractNumber AsNumber(this INumberOperation operation) { if (operation == null) { throw new ArgumentNullException(nameof(operation)); } return(new AbstractNumber(operation)); }
public static IBinaryNumberOperation AsBinary(this INumberOperation operation) { if (operation == null) { throw new ArgumentNullException(nameof(operation)); } return(new NullaryAsBinaryOperation(operation)); }
public AbstractNumber(INumberOperation operation) { if (operation == null) { throw new ArgumentNullException(nameof(operation)); } this.operation = operation; }
public static IUnaryNumberOperation Apply(this IBinaryNumberOperation outer, INumberOperation left, IUnaryNumberOperation right) { if (outer == null) { throw new ArgumentNullException(nameof(outer)); } if (left == null) { throw new ArgumentNullException(nameof(left)); } return(new BinaryNullaryUnaryOperation(outer, left, right)); }
public static INumberOperation Apply(this IUnaryNumberOperation outer, INumberOperation inner) { if (outer == null) { throw new ArgumentNullException(nameof(outer)); } if (inner == null) { throw new ArgumentNullException(nameof(inner)); } return(new UnaryStandardNumber(outer, inner)); }
public NullaryAsUnaryOperation(INumberOperation operation) { this.operation = operation; }