Files
2026-01-12 00:05:22 +01:00

852 B

Math Class

Pow

raise to the power of x

double a = 3;
double b = Math.Pow(a,2);

Sqrt

for the squqre Root

double a = 3;
double b = Math.Sqrt(a);

Abs

for the absolute value

double a = -3;
double b = Math.Abs(a);

round

Round a numeber

double a = 3.14;
double b = Math.Round(a);

Ceiling

round up

double a = 3.14;
double b = Math.Ceilling(a);

Floor

round down

double a = 3.99;
double b = Math.Floor(a);

Max

find the max value

double a = 3.99;
double x = 5;
double b = Math.Max(a,x);

Min

find the min value

double a = 3.99;
double x = 5;
double b = Math.Min(a,x);

Random

Generate a random Number

Random random = new Random();

// for int
int num = random.Next(1, 7);

// for Double
double num  = radom.NextDouble();