uTools-Manuals/docs/c/hypot.html

33 lines
766 B
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<h1>数学函数 - hypot</h1>
<p>原型extern float hypot(float x, float y);</p>
<p>用法:#include &lt;math.h></p>
<p>功能:对于给定的直角三角形的两个直角边,求其斜边的长度。</p>
<p>说明:返回斜边值。</p>
举例:<pre><code class="language-c">
// hypot.c
#include &lt;syslib.h>
#include &lt;math.h>
main()
{
clrscr(); // clear screen
textmode(0x00); // 6 lines per LCD screen
printf("3^2+4^2=%.0f^2\n",hypot(3.,4.));
printf("3.2^2+4.3^2=%.2f^2",hypot(x,y));
getchar();
return 0;
}
</code></pre>相关函数:<a href="frexp.html">frexp</a>,<a href="ldexp.html">ldexp</a>