public override bool Equals(Number other) { if (other == null) { return(false); } DecimalNumber rhs = Cast(other); return(this.Value == rhs.Value); }
private DecimalNumber Cast(Number other) { DecimalNumber rhs = other as DecimalNumber; if (rhs == null) { Number.CompatibilityException(this, other); } return(rhs); }
public override Number Multiply(Number other) { DecimalNumber rhs = Cast(other); return(new DecimalNumber(this.Value * rhs.Value)); }
public override Number Divide(Number other) { DecimalNumber rhs = Cast(other); return(new DecimalNumber(this.Value / rhs.Value)); }
public override Number Subtract(Number other) { DecimalNumber rhs = Cast(other); return(new DecimalNumber(this.Value - rhs.Value)); }