You are viewing an older version of the site. Click here to view
the latest version of this page. (This may be a dead link, if so, try the root page of the docs
here.)
== hypot ==
[[../objects/ms.lang.CastException|ms.lang.CastException]] |- ! scope="row" | Since | 3.3.4 |- ! scope="row" | Restricted |
Copy Code
The output would be:
Copy Code
The output would be:
Copy Code
The output would be:
Copy Code
The output would be:
Given two sides of a right triangle, returns the length of the hypotenuse, using the equation a² + b² = c², where a and b are the arguments provided.
=== Vital Info ===
{| style="width: 40%;" cellspacing="1" cellpadding="1" border="1" class="wikitable"
|-
! scope="col" width="20%" |
! scope="col" width="80%" |
|-
! scope="row" | Name
| hypot
|-
! scope="row" | Returns
| number
|-
! scope="row" | Usages
| a, b
|-
! scope="row" | Throws
| [[../objects/ms.lang.RangeException|ms.lang.RangeException]][[../objects/ms.lang.CastException|ms.lang.CastException]] |- ! scope="row" | Since | 3.3.4 |- ! scope="row" | Restricted |
No
|-
! scope="row" | Optimizations
| None
|}
=== Usages ===
hypot(a, b)=== Examples === ====Example 1==== Standard usage Given the following code:
hypot(3, 4)

1 {{function|hypot}}(3, 4)
:5====Example 2==== Standard usage Given the following code:
hypot(1, 1)

1 {{function|hypot}}(1, 1)
:1.4142135623730951====Example 3==== Standard usage Given the following code:
hypot(2.5, 4.6)

1 {{function|hypot}}(2.5, 4.6)
:5.235456045083369====Example 4==== Values may not be negative Given the following code:
hypot(-1, -1)

1 {{function|hypot}}(-1, -1)
(Throws ms.lang.RangeException: The arguments passed to hypot may not be negative or zero.)
Find a bug in this page? Edit this page yourself, then submit a pull request. (Note this page is automatically generated from the documentation in the source code.)