{
int fd;
ssize_t s;
- uint64_t exp, tot_exp, max_exp;
+ uint64_t expir, tot_expir, max_expir;
struct timespec now;
struct itimerspec new_value;
\&
if (argc != 2 && argc != 4) {
- fprintf(stderr, "%s init\-secs [interval\-secs max\-exp]\[rs]n",
+ fprintf(stderr, "%s init\-secs [interval\-secs max\-num\-expir]\[rs]n",
argv[0]);
exit(EXIT_FAILURE);
}
new_value.it_value.tv_nsec = now.tv_nsec;
if (argc == 2) {
new_value.it_interval.tv_sec = 0;
- max_exp = 1;
+ max_expir = 1;
} else {
new_value.it_interval.tv_sec = atoi(argv[2]);
- max_exp = atoi(argv[3]);
+ max_expir = atoi(argv[3]);
}
new_value.it_interval.tv_nsec = 0;
\&
print_elapsed_time();
printf("timer started\[rs]n");
\&
- for (tot_exp = 0; tot_exp < max_exp;) {
- s = read(fd, &exp, sizeof(uint64_t));
+ for (tot_expir = 0; tot_expir < max_expir;) {
+ s = read(fd, &expir, sizeof(uint64_t));
if (s != sizeof(uint64_t))
err(EXIT_FAILURE, "read");
\&
- tot_exp += exp;
+ tot_expir += expir;
print_elapsed_time();
- printf("read: %" PRIu64 "; total=%" PRIu64 "\[rs]n", exp, tot_exp);
+ printf("read: %" PRIu64 "; total=%" PRIu64 "\[rs]n",
+ expir, tot_expir);
}
\&
exit(EXIT_SUCCESS);
.nf
.B #include <math.h>
.P
-.BI "double frexp(double " x ", int *" exp );
-.BI "float frexpf(float " x ", int *" exp );
-.BI "long double frexpl(long double " x ", int *" exp );
+.BI "double frexp(double " x ", int *" e );
+.BI "float frexpf(float " x ", int *" e );
+.BI "long double frexpl(long double " x ", int *" e );
.fi
.P
.RS -4
.I x
into a
normalized fraction and an exponent which is stored in
-.IR exp .
+.IR e .
.SH RETURN VALUE
These functions return the normalized fraction.
If the argument
.I x
is zero, then the normalized fraction is
zero and zero is stored in
-.IR exp .
+.IR e .
.P
If
.I x
is a NaN,
a NaN is returned, and the value of
-.I *exp
+.I *e
is unspecified.
.P
If
.I x
is positive infinity (negative infinity),
positive infinity (negative infinity) is returned, and the value of
-.I *exp
+.I *e
is unspecified.
.SH ERRORS
No errors occur.
main(int argc, char *argv[])
{
double x, r;
- int exp;
+ int e;
\&
x = strtod(argv[1], NULL);
- r = frexp(x, &exp);
+ r = frexp(x, &e);
\&
- printf("frexp(%g, &e) = %g: %g * %d\[ha]%d = %g\[rs]n", x, r, r, 2, exp, x);
+ printf("frexp(%g, &e) = %g: %g * %d\[ha]%d = %g\[rs]n", x, r, r, 2, e, x);
exit(EXIT_SUCCESS);
}
.EE
.nf
.B #include <math.h>
.P
-.BI "double ldexp(double " x ", int " exp );
-.BI "float ldexpf(float " x ", int " exp );
-.BI "long double ldexpl(long double " x ", int " exp );
+.BI "double ldexp(double " x ", int " e );
+.BI "float ldexpf(float " x ", int " e );
+.BI "long double ldexpl(long double " x ", int " e );
.fi
.P
.RS -4
These functions return the result of multiplying the floating-point number
.I x
by 2 raised to the power
-.IR exp .
+.IR e .
.SH RETURN VALUE
On success, these functions return
-.IR "x * (2\[ha]exp)" .
+.IR "x * (2\[ha]e)" .
.P
If
-.I exp
+.I e
is zero, then
.I x
is returned.
.nf
.B #include <math.h>
.P
-.BI "[[deprecated]] double scalb(double " x ", double " exp );
-.BI "[[deprecated]] float scalbf(float " x ", float " exp );
-.BI "[[deprecated]] long double scalbl(long double " x ", long double " exp );
+.BI "[[deprecated]] double scalb(double " x ", double " e );
+.BI "[[deprecated]] float scalbf(float " x ", float " e );
+.BI "[[deprecated]] long double scalbl(long double " x ", long double " e );
.fi
.P
.RS -4
.B FLT_RADIX
(probably 2)
to the power of
-.IR exp ,
+.IR e ,
that is:
.P
.nf
- x * FLT_RADIX ** exp
+ x * FLT_RADIX ** e
.fi
.P
The definition of
*
.B FLT_RADIX
**
-.IR exp .
+.IR e .
.P
If
.I x
or
-.I exp
+.I e
is a NaN, a NaN is returned.
.P
If
.I x
is positive infinity (negative infinity),
and
-.I exp
+.I e
is not negative infinity,
positive infinity (negative infinity) is returned.
.P
If
.I x
is +0 (\-0), and
-.I exp
+.I e
is not positive infinity, +0 (\-0) is returned.
.P
If
.I x
is zero, and
-.I exp
+.I e
is positive infinity,
a domain error occurs, and
a NaN is returned.
.I x
is an infinity,
and
-.I exp
+.I e
is negative infinity,
a domain error occurs, and
a NaN is returned.
.P
The following errors can occur:
.TP
-Domain error: \f[I]x\f[] is 0, and \f[I]exp\f[] is positive infinity, \
-or \f[I]x\f[] is positive infinity and \f[I]exp\f[] is negative infinity \
+Domain error: \f[I]x\f[] is 0, and \f[I]e\f[] is positive infinity, \
+or \f[I]x\f[] is positive infinity and \f[I]e\f[] is negative infinity \
and the other argument is not a NaN
.I errno
is set to
.nf
.B #include <math.h>
.P
-.BI "double scalbln(double " x ", long " exp );
-.BI "float scalblnf(float " x ", long " exp );
-.BI "long double scalblnl(long double " x ", long " exp );
+.BI "double scalbln(double " x ", long " e );
+.BI "float scalblnf(float " x ", long " e );
+.BI "long double scalblnl(long double " x ", long " e );
.P
-.BI "double scalbn(double " x ", int " exp );
-.BI "float scalbnf(float " x ", int " exp );
-.BI "long double scalbnl(long double " x ", int " exp );
+.BI "double scalbn(double " x ", int " e );
+.BI "float scalbnf(float " x ", int " e );
+.BI "long double scalbnl(long double " x ", int " e );
.fi
.P
.RS -4
.B FLT_RADIX
(probably 2)
to the power of
-.IR exp ,
+.IR e ,
that is:
.P
.nf
- x * FLT_RADIX ** exp
+ x * FLT_RADIX ** e
.fi
.P
The definition of
*
.B FLT_RADIX
**
-.IR exp .
+.IR e .
.P
If
.I x