xref: /illumos-gate/usr/src/man/man3m/scalb.3m (revision bbf215553c7233fbab8a0afdf1fac74c44781867)
166492cf0SYuri Pankov.\"
266492cf0SYuri Pankov.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for
366492cf0SYuri Pankov.\" permission to reproduce portions of its copyrighted documentation.
466492cf0SYuri Pankov.\" Original documentation from The Open Group can be obtained online at
525c28e83SPiotr Jasiukajtis.\" http://www.opengroup.org/bookstore/.
666492cf0SYuri Pankov.\"
766492cf0SYuri Pankov.\" The Institute of Electrical and Electronics Engineers and The Open
866492cf0SYuri Pankov.\" Group, have given us permission to reprint portions of their
966492cf0SYuri Pankov.\" documentation.
1066492cf0SYuri Pankov.\"
1166492cf0SYuri Pankov.\" In the following statement, the phrase ``this text'' refers to portions
1266492cf0SYuri Pankov.\" of the system documentation.
1366492cf0SYuri Pankov.\"
1466492cf0SYuri Pankov.\" Portions of this text are reprinted and reproduced in electronic form
1566492cf0SYuri Pankov.\" in the SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition,
1666492cf0SYuri Pankov.\" Standard for Information Technology -- Portable Operating System
1766492cf0SYuri Pankov.\" Interface (POSIX), The Open Group Base Specifications Issue 6,
1866492cf0SYuri Pankov.\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
1966492cf0SYuri Pankov.\" Engineers, Inc and The Open Group.  In the event of any discrepancy
2066492cf0SYuri Pankov.\" between these versions and the original IEEE and The Open Group
2166492cf0SYuri Pankov.\" Standard, the original IEEE and The Open Group Standard is the referee
2266492cf0SYuri Pankov.\" document.  The original Standard can be obtained online at
2366492cf0SYuri Pankov.\" http://www.opengroup.org/unix/online.html.
2466492cf0SYuri Pankov.\"
2525c28e83SPiotr Jasiukajtis.\" This notice shall appear on any product containing this material.
2666492cf0SYuri Pankov.\"
2766492cf0SYuri Pankov.\" The contents of this file are subject to the terms of the
2866492cf0SYuri Pankov.\" Common Development and Distribution License (the "License").
2966492cf0SYuri Pankov.\" You may not use this file except in compliance with the License.
3066492cf0SYuri Pankov.\"
3166492cf0SYuri Pankov.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
3266492cf0SYuri Pankov.\" or http://www.opensolaris.org/os/licensing.
3366492cf0SYuri Pankov.\" See the License for the specific language governing permissions
3466492cf0SYuri Pankov.\" and limitations under the License.
3566492cf0SYuri Pankov.\"
3666492cf0SYuri Pankov.\" When distributing Covered Code, include this CDDL HEADER in each
3766492cf0SYuri Pankov.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
3866492cf0SYuri Pankov.\" If applicable, add the following below this CDDL HEADER, with the
3966492cf0SYuri Pankov.\" fields enclosed by brackets "[]" replaced with your own identifying
4066492cf0SYuri Pankov.\" information: Portions Copyright [yyyy] [name of copyright owner]
4166492cf0SYuri Pankov.\"
4266492cf0SYuri Pankov.\"
4366492cf0SYuri Pankov.\" Copyright (c) 1992, X/Open Company Limited.  All Rights Reserved.
4466492cf0SYuri Pankov.\" Copyright (c) 2001, The IEEE and The Open Group.  All Rights Reserved.
4566492cf0SYuri Pankov.\" Portions Copyright (c) 2006, Sun Microsystems, Inc. All Rights Reserved.
4624f90e6dSGarrett D'Amore.\" Portions Copyright 2019 Garrett D'Amore <garrett@damore.org>
4724f90e6dSGarrett D'Amore.Dd Jul 05, 2019
4824f90e6dSGarrett D'Amore.Dt SCALB 3M
4924f90e6dSGarrett D'Amore.Os
5024f90e6dSGarrett D'Amore.Sh NAME
5124f90e6dSGarrett D'Amore.Nm scalb ,
5224f90e6dSGarrett D'Amore.Nm scalbf ,
5324f90e6dSGarrett D'Amore.Nm scalbl
5424f90e6dSGarrett D'Amore.Nd load exponent of a radix-independent floating-point number
5524f90e6dSGarrett D'Amore.Sh SYNOPSIS
5624f90e6dSGarrett D'Amore.Ic c99 Oo Ar flag Ns ... Oc Ar file Ns ... Fl lm Op Ar library Ns ...
5724f90e6dSGarrett D'Amore.Pp
5824f90e6dSGarrett D'Amore.In math.h
5925c28e83SPiotr Jasiukajtis.
6024f90e6dSGarrett D'Amore.Ft double
6124f90e6dSGarrett D'Amore.Fo scalb
6224f90e6dSGarrett D'Amore.Fa "double x"
6324f90e6dSGarrett D'Amore.Fa "double n"
6424f90e6dSGarrett D'Amore.Fc
6524f90e6dSGarrett D'Amore.
6624f90e6dSGarrett D'Amore.Ft float
6724f90e6dSGarrett D'Amore.Fo scalbf
6824f90e6dSGarrett D'Amore.Fa "float x"
6924f90e6dSGarrett D'Amore.Fa "float n"
7024f90e6dSGarrett D'Amore.Fc
7124f90e6dSGarrett D'Amore.
7224f90e6dSGarrett D'Amore.Ft "long double"
7324f90e6dSGarrett D'Amore.Fo scalbl
7424f90e6dSGarrett D'Amore.Fa "long double x"
7524f90e6dSGarrett D'Amore.Fa "long double n"
7624f90e6dSGarrett D'Amore.Fc
7724f90e6dSGarrett D'Amore.
7824f90e6dSGarrett D'Amore.Sh DESCRIPTION
7924f90e6dSGarrett D'AmoreThese functions compute
8024f90e6dSGarrett D'Amore.Fa x No * Va r Ns No ^ Ns Fa n ,
8124f90e6dSGarrett D'Amorewhere
8224f90e6dSGarrett D'Amore.Va r
8324f90e6dSGarrett D'Amoreis the radix of the machine's floating point arithmetic.
8424f90e6dSGarrett D'AmoreWhen
8524f90e6dSGarrett D'Amore.Va r
8624f90e6dSGarrett D'Amoreis 2,
8724f90e6dSGarrett D'Amore.Fn scalb
8824f90e6dSGarrett D'Amoreis equivalent to
8924f90e6dSGarrett D'Amore.Xr ldexp 3M .
9024f90e6dSGarrett D'AmoreThe value of
9124f90e6dSGarrett D'Amore.Va r
9224f90e6dSGarrett D'Amoreis
9324f90e6dSGarrett D'Amore.Dv FLT_RADIX
9424f90e6dSGarrett D'Amorewhich is
9524f90e6dSGarrett D'Amoredefined in
9624f90e6dSGarrett D'Amore.In float.h .
9724f90e6dSGarrett D'Amore.Sh RETURN VALUES
9824f90e6dSGarrett D'AmoreUpon successful completion, the
9924f90e6dSGarrett D'Amore.Fn scalb
10024f90e6dSGarrett D'Amorefunction returns
10124f90e6dSGarrett D'Amore.Fa x No * Va r Ns No ^ Ns Fa n .
10224f90e6dSGarrett D'Amore.Pp
10324f90e6dSGarrett D'AmoreIf
10424f90e6dSGarrett D'Amore.Fa x
10524f90e6dSGarrett D'Amoreor
10624f90e6dSGarrett D'Amore.Fa n
10724f90e6dSGarrett D'Amoreis
10824f90e6dSGarrett D'Amore.Sy NaN ,
10924f90e6dSGarrett D'Amorea
11024f90e6dSGarrett D'Amore.Sy NaN
11124f90e6dSGarrett D'Amoreis returned.
11224f90e6dSGarrett D'Amore.Lp
11324f90e6dSGarrett D'AmoreIf
11424f90e6dSGarrett D'Amore.Fa n
11524f90e6dSGarrett D'Amoreis 0,
11624f90e6dSGarrett D'Amore.Fa x
11724f90e6dSGarrett D'Amoreis returned.
11824f90e6dSGarrett D'Amore.Lp
11924f90e6dSGarrett D'AmoreIf
12024f90e6dSGarrett D'Amore.Fa x
12124f90e6dSGarrett D'Amoreis
12224f90e6dSGarrett D'Amore.Sy \(+-Inf
12324f90e6dSGarrett D'Amoreand
12424f90e6dSGarrett D'Amore.Fa n
12524f90e6dSGarrett D'Amoreis not
12624f90e6dSGarrett D'Amore.Sy \(miInf ,
12724f90e6dSGarrett D'Amore.Fa x
12824f90e6dSGarrett D'Amoreis returned.
12924f90e6dSGarrett D'Amore.Lp
13024f90e6dSGarrett D'AmoreIf
13124f90e6dSGarrett D'Amore.Fa x
13224f90e6dSGarrett D'Amoreis \(+-0 and
13324f90e6dSGarrett D'Amore.Fa n
13424f90e6dSGarrett D'Amoreis not
13524f90e6dSGarrett D'Amore.Sy +Inf ,
13624f90e6dSGarrett D'Amore.Fa x
13724f90e6dSGarrett D'Amoreis returned.
13824f90e6dSGarrett D'Amore.Lp
13924f90e6dSGarrett D'AmoreIf
14024f90e6dSGarrett D'Amore.Fa x
14124f90e6dSGarrett D'Amoreis \(+-0 and
14224f90e6dSGarrett D'Amore.Fa n
14324f90e6dSGarrett D'Amoreis
14424f90e6dSGarrett D'Amore.Sy +Inf ,
14524f90e6dSGarrett D'Amorea domain error occurs and a
14624f90e6dSGarrett D'Amore.Sy NaN
14724f90e6dSGarrett D'Amoreis returned.
14824f90e6dSGarrett D'Amore.Lp
14924f90e6dSGarrett D'AmoreIf
15024f90e6dSGarrett D'Amore.Fa x
15124f90e6dSGarrett D'Amoreis
15224f90e6dSGarrett D'Amore.Sy \(+-Inf
15324f90e6dSGarrett D'Amoreand
15424f90e6dSGarrett D'AmoreFa n
15524f90e6dSGarrett D'Amoreis
15624f90e6dSGarrett D'Amore.Sy \(miInf ,
15724f90e6dSGarrett D'Amorea domain error occurs and a
15824f90e6dSGarrett D'Amore.Sy NaN
15924f90e6dSGarrett D'Amoreis returned.
16024f90e6dSGarrett D'Amore.Lp
16124f90e6dSGarrett D'AmoreIf the result would cause an overflow, a range error occurs and
16224f90e6dSGarrett D'Amore.Dv \(+-HUGE_VAL
16324f90e6dSGarrett D'Amore(according to the sign of
16424f90e6dSGarrett D'Amore.Fa x )
16524f90e6dSGarrett D'Amoreis returned.
16624f90e6dSGarrett D'Amore.Lp
16724f90e6dSGarrett D'AmoreFor exceptional cases,
16824f90e6dSGarrett D'Amore.Xr matherr 3M
16924f90e6dSGarrett D'Amoretabulates the values to be returned by
17024f90e6dSGarrett D'Amore.Fn scalb
17124f90e6dSGarrett D'Amoreas specified by SVID3 and XPG3.
17224f90e6dSGarrett D'AmoreSee
173*bbf21555SRichard Lowe.Xr standards 7 .
17424f90e6dSGarrett D'Amore.
17524f90e6dSGarrett D'Amore.Sh ERRORS
17624f90e6dSGarrett D'Amore.
17724f90e6dSGarrett D'AmoreThese functions will fail if:
17824f90e6dSGarrett D'Amore.
17924f90e6dSGarrett D'Amore.Bl -tag -width Sy
18024f90e6dSGarrett D'Amore.It Sy Domain Error
18124f90e6dSGarrett D'AmoreIf
18224f90e6dSGarrett D'Amore.Fa x
18324f90e6dSGarrett D'Amoreis 0 and
18424f90e6dSGarrett D'Amore.Fa n
18524f90e6dSGarrett D'Amoreis
18624f90e6dSGarrett D'Amore.Sy +Inf ,
18724f90e6dSGarrett D'Amoreor
18824f90e6dSGarrett D'Amore.Fa x
18924f90e6dSGarrett D'Amoreis
19024f90e6dSGarrett D'Amore.Sy Inf
19124f90e6dSGarrett D'Amoreand
19224f90e6dSGarrett D'Amore.Fa n
19324f90e6dSGarrett D'Amoreis
19424f90e6dSGarrett D'Amore.Sy \(miInf .
19524f90e6dSGarrett D'Amore.Lp
19624f90e6dSGarrett D'AmoreIf the integer expression
19724f90e6dSGarrett D'Amore.Po Va math_errhandling No & Dv MATH_ERREXCEPT Pc
19824f90e6dSGarrett D'Amore.\" (\fBmath_errhandling\fR & \fBMATH_ERREXCEPT\fR)
19924f90e6dSGarrett D'Amoreis non-zero, then the invalid floating-point exception is raised.
20024f90e6dSGarrett D'Amore.
20124f90e6dSGarrett D'Amore.It Sy Range Error
20224f90e6dSGarrett D'AmoreThe result would overflow.
20324f90e6dSGarrett D'Amore.Lp
20424f90e6dSGarrett D'AmoreIf the integer expression
20524f90e6dSGarrett D'Amore.Po Va math_errhandling No & Dv MATH_ERREXCEPT Pc
20624f90e6dSGarrett D'Amoreis non-zero, then the overflow floating-point exception is raised.
20724f90e6dSGarrett D'Amore.El
20824f90e6dSGarrett D'Amore.
20924f90e6dSGarrett D'Amore.Sh USAGE
21024f90e6dSGarrett D'AmoreAn application wanting to check for exceptions should call
21124f90e6dSGarrett D'Amore.Fn feclearexcept FE_ALL_EXCEPT
21224f90e6dSGarrett D'Amorebefore calling these functions.
21324f90e6dSGarrett D'AmoreOn return, if
21424f90e6dSGarrett D'Amore.Fn fetestexcept "FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW"
21524f90e6dSGarrett D'Amoreis non-zero, an exception has been raised.
21624f90e6dSGarrett D'AmoreAn application should either examine the return value or check the
21724f90e6dSGarrett D'Amorefloating point exception flags to detect exceptions.
21824f90e6dSGarrett D'Amore.
21924f90e6dSGarrett D'Amore.Lp
22024f90e6dSGarrett D'Amore.
22124f90e6dSGarrett D'AmoreThese functions are
22224f90e6dSGarrett D'Amore.Sy Obsolete .
22324f90e6dSGarrett D'AmoreThe
22424f90e6dSGarrett D'Amore.Xr scalbln 3M ,
22524f90e6dSGarrett D'Amore.Xr scalblnf 3M ,
22624f90e6dSGarrett D'Amoreor
22724f90e6dSGarrett D'Amore.Xr scalblnl 3M
22824f90e6dSGarrett D'Amorefunctions should be used instead.
22924f90e6dSGarrett D'Amore.
23024f90e6dSGarrett D'Amore.Sh MT-LEVEL
23124f90e6dSGarrett D'Amore.
23224f90e6dSGarrett D'Amore.Sy MT-Safe .
23324f90e6dSGarrett D'Amore.
23424f90e6dSGarrett D'Amore.Sh INTERFACE STABILITY
23524f90e6dSGarrett D'Amore.
23624f90e6dSGarrett D'AmoreThe
23724f90e6dSGarrett D'Amore.Fn scalb
23824f90e6dSGarrett D'Amorefunction is
23924f90e6dSGarrett D'Amore.Sy Obsolete Standard .
24024f90e6dSGarrett D'AmoreThe
24124f90e6dSGarrett D'Amore.Fn scalbf
24224f90e6dSGarrett D'Amoreand
24324f90e6dSGarrett D'Amore.Fn scalbl
24424f90e6dSGarrett D'Amorefunctions are
24524f90e6dSGarrett D'Amore.Sy Obsolete Committed .
24624f90e6dSGarrett D'Amore.
24724f90e6dSGarrett D'Amore.Sh SEE ALSO
24824f90e6dSGarrett D'Amore.
24924f90e6dSGarrett D'Amore.Xr math.h 3HEAD ,
25024f90e6dSGarrett D'Amore.Xr feclearexcept 3M ,
25124f90e6dSGarrett D'Amore.Xr fetestexcept 3M ,
25224f90e6dSGarrett D'Amore.Xr ilogb 3M ,
25324f90e6dSGarrett D'Amore.Xr ldexp 3M ,
25424f90e6dSGarrett D'Amore.Xr logb 3M ,
25524f90e6dSGarrett D'Amore.Xr matherr 3M ,
25624f90e6dSGarrett D'Amore.Xr scalbln 3M ,
257*bbf21555SRichard Lowe.Xr attributes 7 ,
258*bbf21555SRichard Lowe.Xr standards 7
259