LOGB 3CW "09 March 2006" "mathcw-1.00"

Table of contents


NAME

logbf, logb, logbl, logbw, logbq, logbll, logbdf, logbd, logbdl, logbdll - exponent of argument in native floating-point base

SYNOPSIS

cc [ flags ] -I/usr/local/include file(s) -L/usr/local/lib -lmcw [ ... ]

#include <mathcw.h>

extern float logbf (float x);

extern double logb (double x);

extern long double logbl (long double x);

extern __float80 logbw (__float80 x);

extern __float128 logbq (__float128 x);

extern long_long_double logbll (long_long_double x);

extern decimal_float logbdf (decimal_float x);

extern decimal_double logbd (decimal_double x);

extern decimal_long_double logbdl (decimal_long_double x);

extern decimal_long_long_double logbdll (decimal_long_long_double x);

NB: Functions with prototypes containing underscores in type names may be available only with certain extended compilers.


DESCRIPTION

Compute the exponent of the argument in the floating-point base (FLT_RADIX), as a signed whole number in floating-point format. If x is subnormal, it is treated as though it were normalized; thus, for positive finite nonzero x,
1 <= x * FLT_RADIX**(-logb(x)) < FLT_RADIX
This operation is always exact.

The companion functions scalbn(x,n) and scalbln(x,n) can be used to rescale a value whose exponent is extracted by logb(x).


RETURN VALUES

Return the computed exponent.

ERRORS

If the argument is zero, the result is zero, and errno is not set.

SEE ALSO

frexp(3CW), ldexp(3CW), pow(3CW), scalbln(3CW), scalbn(3CW).