hypot.3m
来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 3M 代码 · 共 74 行
3M
74 行
.TH hypot 3m RISC.ds up \fIulp\fR.ds nn \fINaN\fR.SH Namehypot, cabs \- Euclidean distance, complex absolute value.SH Syntax.nf.B #include <math.h>.PP.B double hypot(\fIx,y\fP).B double \fIx,y;.PP.B float fhypot(float x, float y).PP.B double cabs(\fIz\fP).B struct {double x,y;} \fIz\fP;.PP.B float fcabs(\fIz\fP).B struct {float x,y;} \fIz\fP;.fi.SH Description.NXR "hypot function".NXR "cabs function"The .PN hypot ,.PN fhypot ,.PN cabs ,and.PN fcabsfunctions return the following:.EXsqrt(x\(**x+y\(**y).EEThis computation prevents underflows and overflows only ifthe final result dictates it..PPThe functions.PN fhypotand.PN fcabsare equivalent to the.PN hypotand.PN cabsfunction with the exception of float data type..SS Error When rounding off, for example, below 0.97 \*(ups. Consequently.PN hypot(5.0,12.0)\0=\013.0 exactly;in general,.PN hypotand.PN cabsreturn an integer whenever an integer might be expected..PPThe same cannot be said for the shorter and faster version of.PN hypotand.PN cabsthat is provided in the comments in cabs.c; its error canexceed 1.2 \*(ups..SH Return ValuesIf the correct value overflows, .PN hypotand.PN cabsreturn HUGE_VAL. If.I xor.I yis \*(nn, then \*(nn is returned..SH See Alsomath(3m), sqrt(3m)
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?