Trusted answers to developer questions

Harris Amjad

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

The ** sqrt() function** returns the square root of a double value sent as a parameter.

Figure 1, below, shows the mathematical representation of the `sqrt()`

function.

```
double sqrt(double num)
```

This function requires a double value as a parameter.

`sqrt()`

returns the square root of a double value sent as a parameter.

If the argument is

`NaN`

or`0`

, then the function returns`NaN`

.

class JAVA {public static void main( String args[] ) {//integerSystem.out.println("Math.sqrt(2):");System.out.println(Math.sqrt(2));//perfect square rootSystem.out.println("Math.sqrt(9):");System.out.println(Math.sqrt(9));//negative numberSystem.out.println("Math.sqrt(-4):");System.out.println(Math.sqrt(-4));}}

RELATED TAGS

java

math

squareroot

communitycreator

CONTRIBUTOR

Harris Amjad

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Keep Exploring

Related Courses