diff options
author | Garrett D'Amore <garrett@damore.org> | 2019-07-05 15:04:41 -0700 |
---|---|---|
committer | Garrett D'Amore <garrett@damore.org> | 2019-07-11 11:28:18 -0700 |
commit | 24f90e6d0193ecf0799ac0dee495a53a3e7ee9fa (patch) | |
tree | 985fd2bfefb992a8099088ec25c98eed4cc1d91a /usr/src/man | |
parent | da90d5b8133e037164268f8957ab823e806a7bfb (diff) | |
download | illumos-gate-24f90e6d0193ecf0799ac0dee495a53a3e7ee9fa.tar.gz |
11327 scalb should not be exposed in XPG7
Reviewed by: Andy Fiddaman <omnios@citrus-it.co.uk>
Reviewed by: Toomas Soome <tsoome@me.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Diffstat (limited to 'usr/src/man')
-rw-r--r-- | usr/src/man/man3m/scalb.3m | 335 |
1 files changed, 207 insertions, 128 deletions
diff --git a/usr/src/man/man3m/scalb.3m b/usr/src/man/man3m/scalb.3m index 95e895d57d..ed038d8f2d 100644 --- a/usr/src/man/man3m/scalb.3m +++ b/usr/src/man/man3m/scalb.3m @@ -43,137 +43,216 @@ .\" Copyright (c) 1992, X/Open Company Limited. All Rights Reserved. .\" Copyright (c) 2001, The IEEE and The Open Group. All Rights Reserved. .\" Portions Copyright (c) 2006, Sun Microsystems, Inc. All Rights Reserved. -.\" -.TH SCALB 3M "Jul 12, 2006" "SunOS 5.11" "Mathematical Library Functions" -.SH NAME -scalb, scalbf, scalbl \- load exponent of a radix-independent floating-point -number -.SH SYNOPSIS -.LP -.nf -c99 [ \fIflag\fR... ] \fIfile\fR... \fB-lm\fR [ \fIlibrary\fR... ] -#include <math.h> - -\fBdouble\fR \fBscalb\fR(\fBdouble\fR \fIx\fR, \fBdouble\fR \fIn\fR); -.fi - -.LP -.nf -\fBfloat\fR \fBscalbf\fR(\fBfloat\fR \fIx\fR, \fBfloat\fR \fIn\fR); -.fi - -.LP -.nf -\fBlong double\fR \fBscalbl\fR(\fBlong double\fR \fIx\fR, \fBlong double\fR \fIn\fR); -.fi - -.SH DESCRIPTION -.sp -.LP -These functions compute x * \fIr\fR^n, where \fIr\fR is the radix of the -machine's floating point arithmetic. When \fIr\fR is 2, \fBscalb()\fR is -equivalent to \fBldexp\fR(3M). The value of \fIr\fR is \fBFLT_RADIX\fR which is -defined in <\fBfloat.h\fR>. -.SH RETURN VALUES -.sp -.LP -Upon successful completion, the \fBscalb()\fR function returns \fIx\fR * -\fIr\fR^n. -.sp -.LP -If \fIx\fR or \fIn\fR is NaN, a NaN is returned. -.sp -.LP -If \fIn\fR is 0, \fIx\fR is returned. -.sp -.LP -If \fIx\fR is \(+-Inf and \fIn\fR is not \(miInf, \fIx\fR is returned. -.sp -.LP -If \fIx\fR is \(+-0 and \fIn\fR is not +Inf, \fIx\fR is returned. -.sp -.LP -If \fIx\fR is \(+-0 and \fIn\fR is +Inf, a domain error occurs and a NaN is -returned. -.sp -.LP -If \fIx\fR is \(+-Inf and \fIn\fR is \(miInf, a domain error occurs and a NaN +.\" Portions Copyright 2019 Garrett D'Amore <garrett@damore.org> +.Dd Jul 05, 2019 +.Dt SCALB 3M +.Os +.Sh NAME +.Nm scalb , +.Nm scalbf , +.Nm scalbl +.Nd load exponent of a radix-independent floating-point number +.Sh SYNOPSIS +.Ic c99 Oo Ar flag Ns ... Oc Ar file Ns ... Fl lm Op Ar library Ns ... +.Pp +.In math.h +. +.Ft double +.Fo scalb +.Fa "double x" +.Fa "double n" +.Fc +. +.Ft float +.Fo scalbf +.Fa "float x" +.Fa "float n" +.Fc +. +.Ft "long double" +.Fo scalbl +.Fa "long double x" +.Fa "long double n" +.Fc +. +.Sh DESCRIPTION +These functions compute +.Fa x No * Va r Ns No ^ Ns Fa n , +where +.Va r +is the radix of the machine's floating point arithmetic. +When +.Va r +is 2, +.Fn scalb +is equivalent to +.Xr ldexp 3M . +The value of +.Va r +is +.Dv FLT_RADIX +which is +defined in +.In float.h . +.Sh RETURN VALUES +Upon successful completion, the +.Fn scalb +function returns +.Fa x No * Va r Ns No ^ Ns Fa n . +.Pp +If +.Fa x +or +.Fa n +is +.Sy NaN , +a +.Sy NaN +is returned. +.Lp +If +.Fa n +is 0, +.Fa x is returned. -.sp -.LP +.Lp +If +.Fa x +is +.Sy \(+-Inf +and +.Fa n +is not +.Sy \(miInf , +.Fa x +is returned. +.Lp +If +.Fa x +is \(+-0 and +.Fa n +is not +.Sy +Inf , +.Fa x +is returned. +.Lp +If +.Fa x +is \(+-0 and +.Fa n +is +.Sy +Inf , +a domain error occurs and a +.Sy NaN +is returned. +.Lp +If +.Fa x +is +.Sy \(+-Inf +and +Fa n +is +.Sy \(miInf , +a domain error occurs and a +.Sy NaN +is returned. +.Lp If the result would cause an overflow, a range error occurs and -\(+-\fBHUGE_VAL\fR (according to the sign of \fIx\fR) is returned. -.sp -.LP -For exceptional cases, \fBmatherr\fR(3M) tabulates the values to be returned by -\fBscalb()\fR as specified by SVID3 and XPG3. See \fBstandards\fR(5). -.SH ERRORS -.sp -.LP +.Dv \(+-HUGE_VAL +(according to the sign of +.Fa x ) +is returned. +.Lp +For exceptional cases, +.Xr matherr 3M +tabulates the values to be returned by +.Fn scalb +as specified by SVID3 and XPG3. +See +.Xr standards 5 . +. +.Sh ERRORS +. These functions will fail if: -.sp -.ne 2 -.mk -.na -\fBDomain Error\fR -.ad -.RS 16n -.rt -If \fIx\fR is 0 and \fIn\fR is +Inf, or \fIx\fR is Inf and \fIn\fR is \(miInf. -.sp -If the integer expression (\fBmath_errhandling\fR & \fBMATH_ERREXCEPT\fR) is -non-zero, then the invalid floating-point exception is raised. -.RE - -.sp -.ne 2 -.mk -.na -\fBRange Error\fR -.ad -.RS 16n -.rt +. +.Bl -tag -width Sy +.It Sy Domain Error +If +.Fa x +is 0 and +.Fa n +is +.Sy +Inf , +or +.Fa x +is +.Sy Inf +and +.Fa n +is +.Sy \(miInf . +.Lp +If the integer expression +.Po Va math_errhandling No & Dv MATH_ERREXCEPT Pc +.\" (\fBmath_errhandling\fR & \fBMATH_ERREXCEPT\fR) +is non-zero, then the invalid floating-point exception is raised. +. +.It Sy Range Error The result would overflow. -.sp -If the integer expression (\fBmath_errhandling\fR & \fBMATH_ERREXCEPT\fR) is -non-zero, then the overflow floating-point exception is raised. -.RE - -.SH USAGE -.sp -.LP +.Lp +If the integer expression +.Po Va math_errhandling No & Dv MATH_ERREXCEPT Pc +is non-zero, then the overflow floating-point exception is raised. +.El +. +.Sh USAGE An application wanting to check for exceptions should call -\fBfeclearexcept\fR(\fBFE_ALL_EXCEPT\fR) before calling these functions. On -return, if \fBfetestexcept\fR(\fBFE_INVALID\fR | \fBFE_DIVBYZERO\fR | -\fBFE_OVERFLOW\fR | \fBFE_UNDERFLOW\fR) is non-zero, an exception has been -raised. An application should either examine the return value or check the +.Fn feclearexcept FE_ALL_EXCEPT +before calling these functions. +On return, if +.Fn fetestexcept "FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW" +is non-zero, an exception has been raised. +An application should either examine the return value or check the floating point exception flags to detect exceptions. -.SH ATTRIBUTES -.sp -.LP -See \fBattributes\fR(5) for descriptions of the following attributes: -.sp - -.sp -.TS -tab( ) box; -cw(2.75i) |cw(2.75i) -lw(2.75i) |lw(2.75i) -. -ATTRIBUTE TYPE ATTRIBUTE VALUE -_ -Interface Stability See below. -_ -MT-Level MT-Safe -.TE - -.sp -.LP -The \fBscalb()\fR function is Standard. The \fBscalbf()\fR and \fBscalbl()\fR -functions are Stable. -.SH SEE ALSO -.sp -.LP -\fBfeclearexcept\fR(3M), \fBfetestexcept\fR(3M), \fBilogb\fR(3M), -\fBldexp\fR(3M), \fBlogb\fR(3M), \fBmath.h\fR(3HEAD), \fBmatherr\fR(3M), -\fBscalbln\fR(3M), \fBattributes\fR(5), \fBstandards\fR(5) +. +.Lp +. +These functions are +.Sy Obsolete . +The +.Xr scalbln 3M , +.Xr scalblnf 3M , +or +.Xr scalblnl 3M +functions should be used instead. +. +.Sh MT-LEVEL +. +.Sy MT-Safe . +. +.Sh INTERFACE STABILITY +. +The +.Fn scalb +function is +.Sy Obsolete Standard . +The +.Fn scalbf +and +.Fn scalbl +functions are +.Sy Obsolete Committed . +. +.Sh SEE ALSO +. +.Xr math.h 3HEAD , +.Xr feclearexcept 3M , +.Xr fetestexcept 3M , +.Xr ilogb 3M , +.Xr ldexp 3M , +.Xr logb 3M , +.Xr matherr 3M , +.Xr scalbln 3M , +.Xr attributes 5 , +.Xr standards 5 |