private SymbolicUnit consolidateComplex(SymbolicUnit newPower) { if (!IsNumber || !newPower.IsNumber) { return(new SymbolicUnit(_value, newPower)); } if (IsInteger && newPower.IsInteger) { return(new SymbolicUnit((int)Math.Round(Math.Pow(AsInteger(), newPower.AsInteger())))); } return(new SymbolicUnit(Math.Pow(AsFloat(), newPower.AsFloat()))); }
private bool hasPower() { return(!(_power == null || (_power.IsInteger && _power.AsInteger() == 1))); }