Please enable JavaScript to use CodeHS

AP CSA: CON-1.D.3

CodeHS Lessons

The following static Math methods—including what they do and when they are used—are part of the Java Quick Reference— ● int abs(int x) — Returns the absolute value of an int value ● double abs(double x) — Returns the absolute value of a double value ● double pow(double base, double exponent) — Returns the value of the first parameter raised to the power of the second parameter ● double sqrt(double x) — Returns the positive square root of a double value ● double random()— Returns a double value greater than or equal to 0.0 and less than 1.0

8.10 Using the Math Class
12.7 Class Methods and Class Variables
2.10 Using the Math Class
6.7 Class Methods and Class Variables
4.7 Class Methods and Class Variables