C# TutorialLesson 12Free preview
C# Math
This lesson is part of C# · All levels
Summary
Math classes in the namespace system provide ready-made mathematical functions such as Sqrt, Pow, Abs, Max, Min, and Round. All the methods are called statically by the class name so there's no need to create objects. This class saves time because you don't have to rewrite a proven formula.
Key points
- Math.Abs returns the absolute value, Math.Max and Math.Min select the largest or smallest value.
- Math.Sqrt counts the square root and Math.Pow counts the rank.
- Circulate the decimal number according to the standard decimal rule.
- The constant values Math.PI and Math.E are available for circular and exponential calculations.
- Math classes are static so that their methods are immediately called by the class name.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.