C# Tutorials
C# Methods
C# Classes
C# Examples
The C # Math class has many options that allow you to do math tasks on numbers.
The Math.Max(x, y) method can be used to find the highest values of x and y:
"Math"
.
Max
(
5
, 10
)
;
The Math.Min(x,y) method can be used to find the lowest value of of x and y:
Math
.
Min
(
5
, 10
)
;
The Math.Sqrt(x) method returns the square root of x:
"Math"
.
Sqrt
(
64
)
;
The Math.Abs(x) method returns the absolute (positive) value of x:
"Math"
.
Abs
(
-
4.7
)
;
Math.Round() rounds a number to the nearest whole number:
"Math"
.
Round
(
9.99
)
;