Class MathFunctions
java.lang.Object
it.unimi.di.prog2.s05.MathFunctions
Utility class for computing mathematical functions.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic double
sqrt
(double x) Extracts (if possible) the square root of the given number.
-
Constructor Details
-
MathFunctions
private MathFunctions().
-
-
Method Details
-
sqrt
public static double sqrt(double x) Extracts (if possible) the square root of the given number.- Requires: \( x \geq 0 \).
- Modifies: nothing.
- Effects: returns \( y : | y^2 - x | < 10^{-3} \).
-