Example #1
0
        private string CheckPowers(string value, int index, string exponent, out bool powerSolved)
        {
            string result;

            powerSolved = false;

            if (m_powers.Count == 0)
            {
                return(exponent);
            }

            Power power = m_powers[m_powers.Count - 1];

            if (index == power.parenIndex)
            {
                power.exponent = Convert.ToDouble(exponent);

                result = power.Solve().ToString();
                ReplaceValueInSteps(power.GetExpression(), result);
                m_results.AddValue(m_rawValue);
                m_powers.Remove(power);
                powerSolved = true;

                return(result);
            }

            return(exponent);
        }
Example #2
0
        public void GetExpressionTest()
        {
            Power power = new DomainEntities.Power(2.5);

            power.exponent = 3.5;

            Assert.AreEqual("2.5^3.5", power.GetExpression());
        }