MathF.Truncate() Method in C# with Examples Last Updated : 21 Jun, 2021 Comments Improve Suggest changes Like Article Like Report In C#, MathF.Truncate(Single) is a MathF class method which is used to compute an integral part of a specified single number or single-precision floating-point number.Syntax: public static float Truncate (float x); Parameter: x: It is the specified number which is to be truncated and type of this parameter is System.Single. Return Type: This method only return the integral part of x and discard the fractional part. The type of this method is System.Single.Example: CSharp // C# Program to illustrate the // MathF.Truncate(Single) Method using System; class Geeks { // Main Method public static void Main() { // variables of float type float x1 = 7845.56478452f; float x2 = 12548.3242f; // using method and displaying result Console.WriteLine(MathF.Truncate(x1)); Console.WriteLine(MathF.Truncate(x2)); } } Output: 7845 12548 Comment More infoAdvertise with us Next Article MathF.Round() Method in C# with Examples | Set - 2 K Kirti_Mangal Follow Improve Article Tags : C# CSharp-method CSharp-MathF-Class Similar Reads MathF.Sqrt() Method in C# with Examples In C#, MathF.Sqrt(Single) is a MathF class(present in system namespace) method which is used to calculate the square root of the specified Single or float data type value. Syntax: public static float Sqrt (float x); Here, x is the number whose square root is to be calculated and type of this paramet 2 min read MathF.Min() Method in C# with Examples In C#, Min(Single, Single) is a MathF class method which is used to returns the minimum of the two specified numbers. Syntax: public static float Min (float x, float y); Here, x and y are the two floating point numbers which are compared. Return Type: This method returns the minimum of the two numbe 1 min read MathF.Round() Method in C# with Examples | Set - 1 In C#, MathF.Round() is a MathF class method which is used to round a value to the nearest integer or to the particular number of fractional digits. This method can be overloaded by changing the number and type of arguments passed. There are 4 methods in the overload list of the MathF.Round() method 3 min read MathF.Round() Method in C# with Examples | Set - 2 In C#, MathF.Round() is a MathF class method which is used to round a value to the nearest integer or to the particular number of fractional digits. It returns the nearest value of the number with the precision equal to the second parameter passed. If the value to round is exactly halfway between an 4 min read MathF.Floor() Method in C# with Examples In C#, MathF.Floor(Single) is a MathF class method. This method is used to find the largest integer , which is less than or equal to the specified float value in the argument list. Syntax: public static float Floor (float x); Here, x is the float(Single) value whose floor value has to be calculated. 2 min read MathF.Ceiling() Method in C# with Examples In C#, MathF.Ceiling(Single) is a MathF class method. This method is used to find the smallest integer , which is greater than or equal to the specified single or float value in the argument list. Syntax: public static float Ceiling (float x); Here, x is the float(Single) value whose ceiling value h 1 min read Like