Beispiel #1
0
 // takes the hyperbolic tangent of a number
 public void HyperbolicTangent()
 {
     Entry     = ScientificFunctions.Tanh(Entry);
     first     = true;
     overwrite = true;
 }
Beispiel #2
0
 // takes the inverse tangent of the number and returns it in the selected angle units (rads/degrees)
 public void InverseTangent()
 {
     Entry     = ScientificFunctions.Arctan(Entry, DegreeSelected);
     first     = true;
     overwrite = true;
 }
Beispiel #3
0
 // takes the hyperbolic cosine of a number
 public void HyperbolicCosine()
 {
     Entry     = ScientificFunctions.Cosh(Entry);
     first     = true;
     overwrite = true;
 }
Beispiel #4
0
        //----------triginometric----------

        // takes the sine of the number in the selected angle units (rads/degrees)
        public void Sine()
        {
            Entry     = ScientificFunctions.Sin(Entry, DegreeSelected);
            first     = true;
            overwrite = true;
        }
Beispiel #5
0
 // takes the inverse cosine of the number and returns it in the selected angle units (rads/degrees)
 public void InverseCosine()
 {
     Entry     = ScientificFunctions.Arccos(Entry, DegreeSelected);
     first     = true;
     overwrite = true;
 }
Beispiel #6
0
        //--------------root---------------

        /// <summary>
        /// Cube root of entry
        /// </summary>
        public void CubeRoot()
        {
            Entry     = "" + ScientificFunctions.CubedRoot(Entry);
            first     = true;
            overwrite = true;
        }
Beispiel #7
0
        //-----------logarithmic-----------

        /// <summary>
        /// Natural log of entry
        /// </summary>
        public void NaturalLog()
        {
            Entry     = "" + ScientificFunctions.Ln(Entry);
            first     = true;
            overwrite = true;
        }
Beispiel #8
0
        //----------------------------------------------------------------------------
        //--------------------------End of simple calculator--------------------------
        //----------------------------------------------------------------------------

        //----------------------------------------------------------------------------
        //--------------------------Start of scientific calculator--------------------
        //----------------------------------------------------------------------------


        //-----------exponential-----------

        /// <summary>
        /// Squares entry
        /// </summary>
        public void Square()
        {
            Entry     = ScientificFunctions.Square(Entry);
            first     = true;
            overwrite = true;
        }
Beispiel #9
0
 /// <summary>
 /// Cubes entry
 /// </summary>
 public void Cube()
 {
     Entry     = ScientificFunctions.Cube(Entry);
     first     = true;
     overwrite = true;
 }
Beispiel #10
0
        /// <summary>
        /// Finds new display based on previous operator
        /// </summary>
        public void Equals()
        {
            if (numBase != "dec")
            {
                Entry    = ProgrammerFunctions.ConvertBase(Entry, numBase, "dec");
                PreEntry = ProgrammerFunctions.ConvertBase(PreEntry, preEntryBase, "dec");
            }

            if (operation == "+")
            {
                Entry = StandardFunctions.Add(PreEntry, Entry);
            }
            else if (operation == "-")
            {
                Entry = StandardFunctions.Subtract(PreEntry, Entry);
            }
            else if (operation == "*")
            {
                Entry = StandardFunctions.Multiply(PreEntry, Entry);
            }
            else if (operation == "/")
            {
                Entry = StandardFunctions.Divide(PreEntry, Entry);
            }
            else if (operation == "exp")
            {
                Entry = ScientificFunctions.GenericExponent(PreEntry, Entry);
            }
            else if (operation == "root")
            {
                Entry = ScientificFunctions.GenericRoot(PreEntry, Entry);
            }
            else if (operation == "log")
            {
                Entry = ScientificFunctions.GenericLog(PreEntry, Entry);
            }
            else if (operation == "power")
            {
                Entry = ScientificFunctions.ScientificNotation(Entry);
            }
            else if (operation == "i")
            {
                Entry = StandardFunctions.IntegerDivide(PreEntry, Entry);
            }
            else if (operation == "mod")
            {
                Entry = StandardFunctions.Mod(PreEntry, Entry);
            }

            PreEntry = Entry;

            if (numBase != "dec")
            {
                Entry    = ProgrammerFunctions.ConvertBase(Entry, "dec", numBase);
                PreEntry = ProgrammerFunctions.ConvertBase(PreEntry, "dec", numBase);
            }

            first      = true;
            overwrite  = true;
            operation  = "";
            enteredNum = false;
        }
Beispiel #11
0
        //-----------hyperbolic------------

        // takes the hyperbolic sine of a number
        public void HyperbolicSine()
        {
            entry     = ScientificFunctions.Sinh(entry);
            first     = true;
            overwrite = true;
        }
Beispiel #12
0
 // takes the inverse sine of the number and returns it in the selected angle units (rads/degrees)
 public void InverseSine()
 {
     entry     = ScientificFunctions.Arcsin(entry, degreeSelected);
     first     = true;
     overwrite = true;
 }
Beispiel #13
0
 // takes the tangent of the number in the selected angle units (rads/degrees)
 public void Tangent()
 {
     entry     = ScientificFunctions.Tan(entry, degreeSelected);
     first     = true;
     overwrite = true;
 }
Beispiel #14
0
 // takes the cossine of the number in the selected angle units (rads/degrees)
 public void Cosine()
 {
     entry     = ScientificFunctions.Cos(entry, degreeSelected);
     first     = true;
     overwrite = true;
 }