Introduction To Math Class in C# ASP.NET

Introduction To Math Class in C# ASP.NET

Today, We want to share with you Introduction To Math Class in C# ASP.NET.
In this post we will show you math – C# Mathematical Functions, hear for Mathematical functions in C# .NET we will give you demo and example for implement.In this post, we will learn about Arithmetic in Generic Classes in C# with an example.

Mathematical Calculation in C# using Math Class

Math class can be use for maths related calculation.

some of the useful methods of this class to perform maths related calculation are as below.

Math – C# Mathematical Functions

  • – Math.BigMul(): use for getting the multiplication of two number.
  • – Math.Ceiling(): use for getting a number that is greater than or equal to the specified double-precision floating point number.
  • – Math.Floor(): use for getting an integer that is less than or equal to the specified double-precision floating point number.
  • – Math.Sin(): Returns the sine of the specified angle.
  • – Math.Cos(): Returns the cosine of the specified angle.
  • – Math.Tan(): Returns the tangent of the specified angle.
  • – Math.Sqrt(): Returns the square root of a specified number.
  • – Math.Max(): Returns the larger of two number.
  • – Math.Min(): Returns the smaller of two number.
Read Also:  Insert update delete Using Laravel 5.2 Ajax CRUD laravel without refresh page

C# Programming Examples on Mathematics

using System;

namespace CsharpProgram
{
    class Program
    {
        static void Main(string[] args)
        {
            double Multiplication, CeilingValue, FloorValue;

            Multiplication = Math.BigMul(7823, 2345);

            CeilingValue = Math.Ceiling(76.43);

            FloorValue = Math.Floor(76.43);

            Console.WriteLine("7823 * 2345 = " + Multiplication);

            Console.WriteLine("Ceiling value of 76.43 is " + CeilingValue);

            Console.WriteLine("Floor value of 76.43 is " + FloorValue);

            double sin_Result, cos_Result, tan_Result;

            sin_Result = Math.Sin(30);
            cos_Result = Math.Cos(30);
            tan_Result = Math.Tan(30);

            Console.WriteLine("Sin of angle 30 is " + sin_Result);
            Console.WriteLine("Cos of angle 30 is " + cos_Result);
            Console.WriteLine("Tan of angle 30 is " + tan_Result);

            double SquareRoot;

            SquareRoot = Math.Sqrt(144);

            Console.WriteLine("Square Root of 144 is " + SquareRoot);

            int MaxValue, MinValue;

            MaxValue = Math.Max(34, 76);
            MinValue = Math.Min(34, 76);

            Console.WriteLine("Maximum of 34 and 76 is " + MaxValue);
            Console.WriteLine("Minimum of 34 and 76 is " + MinValue);

            Console.ReadKey();
        }
    }
}

Read :

Read Also:  How to Quickly Index New Post In Google Search

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about C# Programming Examples on Mathematics.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.