The logb() functions are not just ieee754 "test" functions, but are

standard in C99 and POSIX.1-2001+.  They are also not deprecated, since
apart from being standard they can handle special args slightly better
than the ilogb() functions.

Move their documentation to ilogb.3.  Try to use consistent and improved
wording for both sets of functions.  All of ieee854, C99 and POSIX
have better wording and more details for special args.

Add history for the logb() functions and ilogbl().  Fix history for
ilogb().
This commit is contained in:
Bruce Evans 2005-11-06 12:18:27 +00:00
parent 07a61baefe
commit 32948b81c4
4 changed files with 48 additions and 33 deletions

View File

@ -129,10 +129,10 @@ MLINKS+=fmax.3 fmaxf.3 fmax.3 fmaxl.3 \
fmax.3 fmin.3 fmax.3 fminf.3 fmax.3 fminl.3
MLINKS+=fmod.3 fmodf.3
MLINKS+=hypot.3 cabs.3 hypot.3 cabsf.3 hypot.3 hypotf.3
MLINKS+=ieee_test.3 logb.3 ieee_test.3 logbf.3
MLINKS+=ieee_test.3 scalb.3 ieee_test.3 scalbf.3
MLINKS+=ieee_test.3 significand.3 ieee_test.3 significandf.3
MLINKS+=ilogb.3 ilogbf.3 ilogb.3 ilogbl.3
MLINKS+=ilogb.3 ilogbf.3 ilogb.3 ilogbl.3 \
ilogb.3 logb.3 ilogb.3 logbf.3
MLINKS+=j0.3 j1.3 j0.3 jn.3 j0.3 y0.3 j0.3 y1.3 j0.3 y1f.3 j0.3 yn.3
MLINKS+=j0.3 j0f.3 j0.3 j1f.3 j0.3 jnf.3 j0.3 y0f.3 j0.3 ynf.3
MLINKS+=lgamma.3 gamma.3 lgamma.3 gammaf.3 lgamma.3 lgammaf.3 lgamma.3 tgamma.3

View File

@ -32,12 +32,10 @@
.\" from: @(#)ieee.3 6.4 (Berkeley) 5/6/91
.\" $FreeBSD$
.\"
.Dd March 10, 1994
.Dd Nov 6, 2005
.Dt IEEE_TEST 3
.Os
.Sh NAME
.Nm logb ,
.Nm logbf ,
.Nm scalb ,
.Nm scalbf ,
.Nm significand ,
@ -48,10 +46,6 @@
.Sh SYNOPSIS
.In math.h
.Ft double
.Fn logb "double x"
.Ft float
.Fn logbf "float x"
.Ft double
.Fn scalb "double x" "double n"
.Ft float
.Fn scalbf "float x" "float n"
@ -64,18 +58,6 @@ These functions allow users to test conformance to
.St -ieee754 .
Their use is not otherwise recommended.
.Pp
.Fn logb x
and
.Fn logbf x
return
.Fa x Ns 's exponent
.Fa n ,
a signed integer converted to double\-precision floating\-point.
.Fn logb \*(Pm\*(If
= +\*(If;
.Fn logb 0
= -\*(If with a division by zero exception.
.Pp
.Fn scalb x n
and
.Fn scalbf x n

View File

@ -32,13 +32,15 @@
.\" from: @(#)ieee.3 6.4 (Berkeley) 5/6/91
.\" $FreeBSD$
.\"
.Dd January 26, 2005
.Dd Nov 6, 2005
.Dt ILOGB 3
.Os
.Sh NAME
.Nm ilogb ,
.Nm ilogbf ,
.Nm ilogbl
.Nm ilogbl ,
.Nm logb ,
.Nm logbf
.Nd extract exponent
.Sh LIBRARY
.Lb libm
@ -50,24 +52,40 @@
.Fn ilogbf "float x"
.Ft int
.Fn ilogbl "long double x"
.Ft double
.Fn logb "double x"
.Ft float
.Fn logbf "float x"
.Sh DESCRIPTION
.Fn ilogb ,
.Fn ilogbf
and
.Fn ilogbl
return
.Fa x Ns 's exponent,
.Fa x Ns 's exponent
in integer format.
.Fn ilogb \*(Pm\*(If
returns
.Dv INT_MAX ,
.Fn ilogb \*(Pm\*(Na
returns
.Dv FP_ILOGBNAN
.Dv FP_ILOGBNAN ,
and
.Fn ilogb 0
returns
.Dv FP_ILOGB0 .
.Pp
.Fn logb x
and
.Fn logbf x
return
.Fa x Ns 's exponent
in floating\-point format with the same precision as
.Fa x .
.Fn logb \*(Pm\*(If
returns +\*(If, and
.Fn logb 0
returns -\*(If with a division by zero exception.
.Sh SEE ALSO
.Xr frexp 3 ,
.Xr ieee 3 ,
@ -77,19 +95,33 @@ returns
The
.Fn ilogb ,
.Fn ilogbf ,
.Fn ilogbl ,
.Fn logb
and
.Fn ilogbl
.Fn logbf
routines conform to
.St -isoC-99 .
They provide functionality similar to the Logb function recommended by
.Fn logb
and
.Fn logbf
implement the logb function recommended by
.St -ieee754 .
.Sh HISTORY
The
.Fn logb
function appeared in
.Bx 4.3 .
The
.Fn ilogb
and
function appeared in
.Fx 1.1.5 .
The
.Fn ilogbf
functions appeared in
.Bx 4.3
and
.Fx 2.0 ,
respectively.
.Fn logbf
functions appeared in
.Fx 2.0 .
The
.Fn ilogbl
function appeared in
.Fx 5.4 .

View File

@ -32,7 +32,7 @@
.\" from: @(#)math.3 6.10 (Berkeley) 5/6/91
.\" $FreeBSD$
.\"
.Dd April 5, 2005
.Dd Nov 6, 2005
.Dt MATH 3
.Os
.if n \{\
@ -97,6 +97,7 @@ isnormal determine whether a value is normalized
frexp extract exponent and mantissa
ilogb extract exponent
ldexp multiply by power of 2
logb extract exponent
scalbln adjust exponent
scalbn adjust exponent
.El