Javascript Reference - JavaScript SQRT1_2 Property








The SQRT1_2 property returns the square root of 1/2, approximately 0.707.

Browser Support

SQRT1_2 Yes Yes Yes Yes Yes

Syntax

Math.SQRT1_2

Return Value

A Number representing the square root of 1/2.

Example


<!DOCTYPE html>
<html>
<body>
<button onclick="myFunction()">test</button>
<p id="demo"></p>
<script>
function myFunction() {<!-- ww w  .  j  a  va  2s . com-->
    document.getElementById("demo").innerHTML = Math.SQRT1_2;
}
</script>

</body>
</html>

The code above is rendered as follows: