2004-11-03 13:51:07 +00:00
|
|
|
.\" Copyright 1995 Jim Van Zandt <jrv@vanzandt.mv.com>
|
2008-08-01 05:26:11 +00:00
|
|
|
.\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk
|
|
|
|
.\" <mtk.manpages@gmail.com>
|
2004-11-03 13:51:07 +00:00
|
|
|
.\"
|
|
|
|
.\" Permission is granted to make and distribute verbatim copies of this
|
|
|
|
.\" manual provided the copyright notice and this permission notice are
|
|
|
|
.\" preserved on all copies.
|
|
|
|
.\"
|
|
|
|
.\" Permission is granted to copy and distribute modified versions of this
|
|
|
|
.\" manual under the conditions for verbatim copying, provided that the
|
|
|
|
.\" entire resulting derived work is distributed under the terms of a
|
|
|
|
.\" permission notice identical to this one.
|
2007-04-12 22:42:49 +00:00
|
|
|
.\"
|
2004-11-03 13:51:07 +00:00
|
|
|
.\" Since the Linux kernel and libraries are constantly changing, this
|
|
|
|
.\" manual page may be incorrect or out-of-date. The author(s) assume no
|
|
|
|
.\" responsibility for errors or omissions, or for damages resulting from
|
|
|
|
.\" the use of the information contained herein. The author(s) may not
|
|
|
|
.\" have taken the same level of care in the production of this manual,
|
|
|
|
.\" which is licensed free of charge, as they might when working
|
|
|
|
.\" professionally.
|
2007-04-12 22:42:49 +00:00
|
|
|
.\"
|
2004-11-03 13:51:07 +00:00
|
|
|
.\" Formatted or processed versions of this manual, if unaccompanied by
|
|
|
|
.\" the source, must acknowledge the copyright and authors of this work.
|
|
|
|
.\"
|
|
|
|
.\" Modified 2002-07-27 Walter Harms
|
|
|
|
.\" (walter.harms@informatik.uni-oldenburg.de)
|
|
|
|
.\"
|
2010-09-11 15:24:18 +00:00
|
|
|
.TH EXPM1 3 2010-09-12 "" "Linux Programmer's Manual"
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH NAME
|
2008-08-01 05:26:11 +00:00
|
|
|
expm1, expm1f, expm1l \- exponential minus 1
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH SYNOPSIS
|
|
|
|
.nf
|
|
|
|
.B #include <math.h>
|
|
|
|
.sp
|
|
|
|
.BI "double expm1(double " x );
|
2004-11-11 17:28:42 +00:00
|
|
|
.br
|
2004-11-03 13:51:07 +00:00
|
|
|
.BI "float expm1f(float " x );
|
2004-11-11 17:28:42 +00:00
|
|
|
.br
|
2004-11-03 13:51:07 +00:00
|
|
|
.BI "long double expm1l(long double " x );
|
|
|
|
.sp
|
|
|
|
.fi
|
2007-07-21 05:25:03 +00:00
|
|
|
Link with \fI\-lm\fP.
|
2007-07-08 12:11:40 +00:00
|
|
|
.sp
|
|
|
|
.in -4n
|
|
|
|
Feature Test Macro Requirements for glibc (see
|
|
|
|
.BR feature_test_macros (7)):
|
|
|
|
.in
|
|
|
|
.sp
|
|
|
|
.ad l
|
2008-08-01 05:26:11 +00:00
|
|
|
.BR expm1 ():
|
2010-09-18 10:03:59 +00:00
|
|
|
.RS 4
|
|
|
|
_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 ||
|
|
|
|
_XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED || _ISOC99_SOURCE ||
|
brk.2, chroot.2, faccessat.2, fchmodat.2, fchownat.2, fstatat.2, futimesat.2, getdtablesize.2, getpagesize.2, getsid.2, linkat.2, mkdirat.2, mknodat.2, openat.2, pread.2, readlinkat.2, renameat.2, setpgid.2, sigaltstack.2, symlinkat.2, sync.2, timer_create.2, timer_delete.2, timer_getoverrun.2, timer_settime.2, unlinkat.2, utimensat.2, vfork.2, acosh.3, asinh.3, atanh.3, dirfd.3, dprintf.3, ecvt.3, expm1.3, fexecve.3, fmemopen.3, gcvt.3, getcwd.3, gethostid.3, getpass.3, getsubopt.3, getw.3, mbsnrtowcs.3, mkfifoat.3, mkstemp.3, mktemp.3, opendir.3, posix_memalign.3, rint.3, siginterrupt.3, stpcpy.3, stpncpy.3, strdup.3, strerror.3, strnlen.3, strsignal.3, strtol.3, strtoul.3, ualarm.3, usleep.3, wcpcpy.3, wcpncpy.3, wcscasecmp.3, wcsdup.3, wcsncasecmp.3, wcsnlen.3, wcsnrtombs.3: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2010-09-19 06:02:38 +00:00
|
|
|
_POSIX_C_SOURCE\ >=\ 200112L;
|
2010-09-18 10:03:59 +00:00
|
|
|
.br
|
|
|
|
or
|
2008-08-01 05:26:11 +00:00
|
|
|
.I cc\ -std=c99
|
2010-09-18 10:03:59 +00:00
|
|
|
.RE
|
2008-08-01 05:26:11 +00:00
|
|
|
.br
|
2007-07-08 12:11:40 +00:00
|
|
|
.BR expm1f (),
|
|
|
|
.BR expm1l ():
|
2010-09-18 10:03:59 +00:00
|
|
|
.RS 4
|
|
|
|
_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE ||
|
brk.2, chroot.2, faccessat.2, fchmodat.2, fchownat.2, fstatat.2, futimesat.2, getdtablesize.2, getpagesize.2, getsid.2, linkat.2, mkdirat.2, mknodat.2, openat.2, pread.2, readlinkat.2, renameat.2, setpgid.2, sigaltstack.2, symlinkat.2, sync.2, timer_create.2, timer_delete.2, timer_getoverrun.2, timer_settime.2, unlinkat.2, utimensat.2, vfork.2, acosh.3, asinh.3, atanh.3, dirfd.3, dprintf.3, ecvt.3, expm1.3, fexecve.3, fmemopen.3, gcvt.3, getcwd.3, gethostid.3, getpass.3, getsubopt.3, getw.3, mbsnrtowcs.3, mkfifoat.3, mkstemp.3, mktemp.3, opendir.3, posix_memalign.3, rint.3, siginterrupt.3, stpcpy.3, stpncpy.3, strdup.3, strerror.3, strnlen.3, strsignal.3, strtol.3, strtoul.3, ualarm.3, usleep.3, wcpcpy.3, wcpncpy.3, wcscasecmp.3, wcsdup.3, wcsncasecmp.3, wcsnlen.3, wcsnrtombs.3: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2010-09-19 06:02:38 +00:00
|
|
|
_POSIX_C_SOURCE\ >=\ 200112L;
|
2010-09-18 10:03:59 +00:00
|
|
|
.br
|
|
|
|
or
|
2007-07-08 12:11:40 +00:00
|
|
|
.I cc\ -std=c99
|
2010-09-18 10:03:59 +00:00
|
|
|
.RE
|
2007-07-08 12:11:40 +00:00
|
|
|
.ad b
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH DESCRIPTION
|
2007-12-18 07:35:55 +00:00
|
|
|
.I expm1(x)
|
2007-12-20 12:12:32 +00:00
|
|
|
returns a value equivalent to
|
2007-12-18 07:35:55 +00:00
|
|
|
.nf
|
|
|
|
|
|
|
|
exp(x) \- 1
|
|
|
|
|
|
|
|
.fi
|
2007-06-08 11:25:04 +00:00
|
|
|
It is
|
2004-11-03 13:51:07 +00:00
|
|
|
computed in a way that is accurate even if the value of \fIx\fP is near
|
2007-12-18 07:35:55 +00:00
|
|
|
zero\(ema case where
|
|
|
|
.I "exp(x) \- 1"
|
|
|
|
would be inaccurate due to
|
2004-11-03 13:51:07 +00:00
|
|
|
subtraction of two numbers that are nearly equal.
|
2008-08-01 05:26:11 +00:00
|
|
|
.SH RETURN VALUE
|
|
|
|
On success, these functions return
|
|
|
|
.IR "exp(x)\ \-\ 1" .
|
|
|
|
|
|
|
|
If
|
|
|
|
.I x
|
|
|
|
is a NaN,
|
|
|
|
a NaN is returned.
|
|
|
|
|
|
|
|
If
|
|
|
|
.I x
|
|
|
|
is +0 (\-0),
|
|
|
|
+0 (\-0) is returned.
|
|
|
|
|
|
|
|
If
|
|
|
|
.I x
|
|
|
|
is positive infinity, positive infinity is returned.
|
|
|
|
|
|
|
|
If
|
|
|
|
.I x
|
|
|
|
is negative infinity, \-1 is returned.
|
|
|
|
|
2008-08-04 16:00:58 +00:00
|
|
|
If the result overflows, a range error occurs,
|
2008-08-01 05:26:11 +00:00
|
|
|
and the functions return
|
|
|
|
.RB - HUGE_VAL ,
|
|
|
|
.RB - HUGE_VALF ,
|
|
|
|
or
|
|
|
|
.RB - HUGE_VALL ,
|
|
|
|
respectively.
|
|
|
|
.SH ERRORS
|
|
|
|
See
|
|
|
|
.BR math_error (7)
|
|
|
|
for information on how to determine whether an error has occurred
|
|
|
|
when calling these functions.
|
|
|
|
.PP
|
|
|
|
The following errors can occur:
|
|
|
|
.TP
|
|
|
|
Range error, overflow
|
2010-09-11 15:24:18 +00:00
|
|
|
.I errno
|
|
|
|
is set to
|
|
|
|
.BR ERANGE
|
|
|
|
(but see BUGS).
|
2008-08-01 05:26:11 +00:00
|
|
|
An overflow floating-point exception
|
|
|
|
.RB ( FE_OVERFLOW )
|
|
|
|
is raised.
|
|
|
|
.\"
|
|
|
|
.\" POSIX.1 specifies an optional range error (underflow) if
|
|
|
|
.\" x is subnormal. Glibc does not implement this.
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH "CONFORMING TO"
|
2008-08-01 05:26:11 +00:00
|
|
|
C99, POSIX.1-2001.
|
|
|
|
.\" BSD.
|
|
|
|
.SH BUGS
|
|
|
|
For some large negative
|
|
|
|
.I x
|
2008-08-04 05:00:32 +00:00
|
|
|
values (where the function result approaches \-1),
|
2008-08-01 05:26:11 +00:00
|
|
|
.BR expm1 ()
|
2008-08-04 05:27:01 +00:00
|
|
|
raises a bogus underflow floating-point exception.
|
2008-08-04 05:00:32 +00:00
|
|
|
.\" FIXME .
|
2008-08-01 05:26:11 +00:00
|
|
|
.\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6778
|
2008-08-04 05:00:32 +00:00
|
|
|
|
|
|
|
For some large positive
|
|
|
|
.I x
|
|
|
|
values,
|
|
|
|
.BR expm1 ()
|
2008-08-04 05:27:01 +00:00
|
|
|
raises a bogus invalid floating-point exception in addition to the expected
|
2008-08-04 05:00:32 +00:00
|
|
|
overflow exception, and returns a NaN instead of positive infinity.
|
|
|
|
.\" FIXME .
|
|
|
|
.\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6814
|
|
|
|
.\" e.g., expm1(1e5) through expm1(1.00199970127e5),
|
|
|
|
.\" but not expm1(1.00199970128e5) and beyond.
|
2010-09-12 06:38:17 +00:00
|
|
|
|
2010-09-11 15:24:18 +00:00
|
|
|
Before version 2.11,
|
|
|
|
.\" It looks like the fix was in 2.11, or possibly 2.12.
|
|
|
|
.\" I have no test system for 2.11, but 2.12 passes.
|
|
|
|
.\" From the source (sysdeps/i386/fpu/s_expm1.S) it looks
|
|
|
|
.\" like the changes were in 2.11.
|
|
|
|
the glibc implementation did not set
|
|
|
|
.\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=6788
|
|
|
|
.I errno
|
|
|
|
to
|
|
|
|
.B ERANGE
|
|
|
|
when a range error occurred.
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH "SEE ALSO"
|
|
|
|
.BR exp (3),
|
|
|
|
.BR log (3),
|
|
|
|
.BR log1p (3)
|