exp.3m

来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 3M 代码 · 共 173 行

3M
173
字号
.TH exp 3m RISC.ds nn \fINaN\fR.ds up \fIulp\fR.SH Nameexp, expm1, log, log10, log1p, pow \- exponential, logarithm, power.SH Syntax.nf.B #include <math.h>.PP.B double exp(\fIx\fP).B double \fIx\fP;.PP.B float fexp(\fIx\fP).B float \fIx\fP;.PP.B double expm1(\fIx\fP).B double \fIx\fP;.PP.B float fexpm1(\fIx\fP).B float \fIx\fP;.PP.B double log(\fIx\fP).B double \fIx\fP;.PP.B float flog(\fIx\fP).B float \fIx\fP;.PP.B double log10(\fIx\fP).B double \fIx\fP;.PP.B float flog10(\fIx\fP).B float \fIx\fP;.PP.B double log1p(\fIx\fP).B double \fIx\fP;.PP.B float flog1p(\fIx\fP).B float \fIx\fP;.PP.B double pow(\fIx,y\fP).B double \fIx,y\fP;.fi.SH Description.NXR "exp function".NXR "fexp function".NXR "expm1 function".NXR "fexpm1 function".NXR "log function".NXR "flog function".NXR "log10 function".NXR "flog10 function".NXR "log1p function".NXR "flog1p function".PPThe .PN expand .PN fexpfunctions return the exponential function of \fIx\fPfor double and float data types, respectively..PPThe .PN expm1 and .PN fexpm1functions return exp(\fIx\fP\)-1 accurately, including tiny \fIx\fP for doubleand float data types, respectively..PPThe.PN logand.PN flogfunctions return the natural logarithm of \fIx\fPfor double and float data types, respectively..PPThe .PN log10and .PN flog10functions return the logarithm of \fIx\fP to base 10for double and float data types, respectively..PPThe .PN log1pand.PN flog1pfunctions return log(1+\fIx\fP) accurately, including tiny \fIx\fPfor double and float data types, respectively..PPThe.PN powfunction returns .I x**y..NXR "pow function".SS Error (due to roundoff) The .PN exp ,.PN log ,.PN expm1 ,and .PN log1pfunctions are accurate to within an \*(up, and .PN log10 is accurate to within approximately 2 \*(ups;an \*(up is one \fIU\fRnit in the \fIL\fRast \fIP\fRlace..PPThe .PN powfunction is accurate to within 2 \*(ups when itsmagnitude is moderate, but becomes less accurate as the .PN pow result approaches the overflow or underflow thresholds. Theoretically, as these thresholds are approached, almost as many bitscould be lost from the result as are indicated in the exponent field ofthe floating-point format for the resultant number.  In other words, upto 11 bits for an IEEE 754 double-precision floating-point number.  However, testing has never verified loss of precision as drastic as 11bits.  The worst cases have shown accuracy of results to within 300 \*(ups for IEEE 754 double-precision floating-point numbers.  Ingeneral, a.PN pow(integer, integer) result is exact until it is larger than 2**53(for IEEE 754 double-precision floating-point)..SH Return ValuesAll of the double precision functions return \*(nn if.I xor.I yis \*(nn..PPThe .PN expfunction returns HUGE_VAL when the correct value would overflow,and zero when the correct value would underflow..PPThe .PN logand.PN log10functions return \*(nn when.I xis less than or equal to zero or when the correct value would overflow..PPThe.PN powfunction returns \*(nn if.I xor.I yis \*(nn.  When both.I xand.I yare zero, 1.0 is returned.  When.I xis negative and.I yis not an integer, \*(nn is returned.  If.I xis zero and.I yis negative, -HUGE_VAL is returned..PPThe.PN sqrtfunction returns \*(nn when.I xis negative..SH See Alsomath(3m)

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?