用户工具

站点工具


reference:language:hypot

差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

两侧同时换到之前的修订记录 前一修订版
后一修订版
前一修订版
reference:language:hypot [2015/10/10 02:33]
nzhu
reference:language:hypot [2017/04/07 10:03] (当前版本)
行 1: 行 1:
 ====== hypot() ====== ====== hypot() ======
  
-===== Description ​===== +===== 描述 ​===== 
- The hypot() function returns sqrt(x*x + y*y). This is the length of the hypotenuse of a right triangle with sides of length x and y, or the distance of the point (x, y) from the origin. Using this function instead of the direct formula is wise, since the error is much smaller. No underflow with small x and y. No overflow if result is in range. +hypot函数对于给定的直角三角形的两个直角边,求其斜边的长度。 
-==== Syntax ​====+==== 语法 ​====
   
 hypot(x, y); hypot(x, y);
-=== Parameters ​===+=== 参数 ​===
   
 x int or float: x-coordinate of the point x int or float: x-coordinate of the point
行 12: 行 12:
 y int or float: y-coordinate of the point y int or float: y-coordinate of the point
  
-Returns float+返回 ​     float
reference/language/hypot.txt · 最后更改: 2017/04/07 10:03 (外部编辑)