hypot

2018-11-11 15:38 更新


 原型:extern float hypot(float x, float y);
 
 用法:#include <math.h>
 
 功能:对于给定的直角三角形的两个直角边,求其斜边的长度。
 
 说明:返回斜边值。
 
 举例:


     // hypot.c
     
     #include <syslib.h>
     #include <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;
     }      


以上内容是否对您有帮助:
在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号