public class OurMath
1: /**
2: A class of static methods to perform various mathematical
3: computations, including the square root.
4: @author Frank M. Carrano
5: @author Timothy M. Henry
6: @version 5.0
7: */
8: public class OurMath
9: {
10: /** Computes the square root of a nonnegative real number.
11: @param value A real value whose square root is desired.
12: @return The square root of the given value.
13: @throws SquareRootException if value < 0. */
14: public static double squareRoot(double value) throws SquareRootException
15: {
16: if (value < 0)
17: throw new SquareRootException();
18: else
19: return Math.sqrt(value);
20: } // end squareRoot
21:
22: // < Other methods not relevant to this discussion are here. >
23:
24: } // end OurMath