Exemplo n.º 1
0
        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())));
        }
Exemplo n.º 2
0
 private bool hasPower()
 {
     return(!(_power == null ||
              (_power.IsInteger && _power.AsInteger() == 1)));
 }