MathF.Abs() Method in C# with Examples Last Updated : 04 Apr, 2019 Comments Improve Suggest changes Like Article Like Report MathF.Abs(Single) Method is used to return the absolute value of a specified float number. Syntax: public static float Abs (float x); Here, it takes a standard floating point number. Return Value: This method returns a floating point value less than Single.MaxValue. Example 1: csharp // C# program to demonstrate the // MathF.Abs(Single) Method using System; class GFG { // Main Method public static void Main() { // Declaring and initializing value float value = 4.5f; // Getting absolute float // using Abs() method float round = MathF.Abs(value); // Display the value Console.WriteLine("Absolute float value is {0}", round); } } Output: Absolute float value is 4.5 Example 2: csharp // C# program to demonstrate the // MathF.Abs(Single) Method using System; using System.Globalization; class GFG { // Main Method public static void Main() { // calling get() method get(20f); get(30.5f); get(40.5f); get(4294.586f); } // defining get() method public static void get(float value) { // getting absolute float // using Abs() method float round = MathF.Abs(value); // Display the value Console.WriteLine("Float value is {0}", round); } } Output: Float value is 20 Float value is 30.5 Float value is 40.5 Float value is 4294.586 Comment More infoAdvertise with us Next Article MathF.Asin() Method in C# with Examples R rohitprasad3 Follow Improve Article Tags : C# CSharp-method CSharp-MathF-Class Similar Reads MathF.Asin() Method in C# with Examples MathF.Asin() Method is used to return the angle whose sine is given as a single(or float) value argument. If the argument is NaN, then the result will be NaN. Syntax: public static float Asin (float x); Here, it takes a standard floating point number. Return Value: This method returns an angle 2 min read MathF.Acos() Method in C# with Examples MathF.Acos(Single) Method is used to return the angle whose cosine is given as a single or float value argument. If the argument is NaN, then the result will be NaN. Syntax: public static float Acos (float x); Here, it takes a standard floating point number. Return Value: This method returns an angl 2 min read MathF.Cos() Method in C# with Examples MathF.Cos(Single) is an inbuilt MathF class method which returns the cosine of a given float value argument(specified angle). Syntax: public static float Cos (float x); Here, x is the angle(measured in radian) whose cosine is to be returned and the type of this parameter is System.Single. Return Val 2 min read MathF.Sin() Method in C# with Examples MathF.Sin(Single) is an inbuilt MathF class method which returns the sine of a given float value argument(specified angle). Syntax: public static float Sin (float x); Here, x is the angle(measured in radian) whose sine is to be returned and the type of this parameter is System.Single. Return Value: 2 min read MathF.Log() Method in C# with Examples In C#, MathF.Log() is a MathF class method. It is used to return the logarithm of a specified number. This method can be overloaded by changing the number of the arguments passed. There are total 2 methods in the overload list of the MathF.Log() method as follows: MathF.Log(Single) Method MathF.Log( 4 min read MathF.Tan() Method in C# with Examples MathF.Tan(Single) is an inbuilt MathF class method which returns the tangent of a given float value argument(specified angle). Syntax: public static float Tan (float x); Here, x is the angle(measured in radian) whose tangent is to be returned and the type of this parameter is System.Single. Return V 2 min read Like