Here you can find the source of sqrt(double a)
Parameter | Description |
---|---|
a | a value |
public static double sqrt(double a)
//package com.java2s; //License from project: Open Source License public class Main { /**//from w ww. j a va2s . c o m * Returns the correctly rounded positive square root of a {@code double} * value. Special cases: * <ul><li>If the argument is NaN or less than zero, then the result is NaN. * <li>If the argument is positive infinity, then the result is positive * infinity. * <li>If the argument is positive zero or negative zero, then the result is * the same as the argument.</ul> * Otherwise, the result is the {@code double} value closest to the true * mathematical square root of the argument value. * * @param a a value * @return the positive square root of {@code a}. If the argument is NaN or * less than zero, the result is NaN */ public static double sqrt(double a) { return Math.sqrt(a); } }