2011-03-18 16:52:16 +01:00
|
|
|
.\" Copyright (c) 1985, 1991 Regents of the University of California.
|
|
|
|
.\" All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\" 3. Neither the name of the University nor the names of its contributors
|
|
|
|
.\" may be used to endorse or promote products derived from this software
|
|
|
|
.\" without specific prior written permission.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
|
|
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
.\" SUCH DAMAGE.
|
|
|
|
.\"
|
|
|
|
.\" from: @(#)exp.3 6.12 (Berkeley) 7/31/91
|
|
|
|
.\" $FreeBSD: src/lib/msun/man/exp.3,v 1.24 2008/01/18 21:43:00 das Exp $
|
2013-12-06 12:04:52 +01:00
|
|
|
.\" $NetBSD: exp.3,v 1.29 2012/11/06 21:43:37 dholland Exp $
|
2011-03-18 16:52:16 +01:00
|
|
|
.\"
|
2013-12-06 12:04:52 +01:00
|
|
|
.Dd September 13, 2011
|
2011-03-18 16:52:16 +01:00
|
|
|
.Dt EXP 3
|
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm exp ,
|
|
|
|
.Nm expf ,
|
|
|
|
.\" The sorting error is intentional. exp and expf should be adjacent.
|
|
|
|
.Nm exp2 ,
|
|
|
|
.Nm exp2f ,
|
|
|
|
.\" .Nm exp2l ,
|
|
|
|
.Nm expm1 ,
|
|
|
|
.Nm expm1f ,
|
2013-12-06 12:04:52 +01:00
|
|
|
.Nd exponential functions
|
2011-03-18 16:52:16 +01:00
|
|
|
.Sh LIBRARY
|
|
|
|
.Lb libm
|
|
|
|
.Sh SYNOPSIS
|
|
|
|
.In math.h
|
|
|
|
.Ft double
|
|
|
|
.Fn exp "double x"
|
|
|
|
.Ft float
|
|
|
|
.Fn expf "float x"
|
|
|
|
.Ft double
|
|
|
|
.Fn exp2 "double x"
|
|
|
|
.Ft float
|
|
|
|
.Fn exp2f "float x"
|
|
|
|
.\" .Ft long double
|
|
|
|
.\" .Fn exp2l "long double x"
|
|
|
|
.Ft double
|
|
|
|
.Fn expm1 "double x"
|
|
|
|
.Ft float
|
|
|
|
.Fn expm1f "float x"
|
|
|
|
.Sh DESCRIPTION
|
|
|
|
The
|
|
|
|
.Fn exp
|
2013-12-06 12:04:52 +01:00
|
|
|
and
|
2011-03-18 16:52:16 +01:00
|
|
|
.Fn expf
|
|
|
|
functions compute the base
|
|
|
|
.Ms e
|
|
|
|
exponential value of the given argument
|
|
|
|
.Fa x .
|
|
|
|
.Pp
|
|
|
|
The
|
2013-12-06 12:04:52 +01:00
|
|
|
.Fn exp2
|
2011-03-18 16:52:16 +01:00
|
|
|
and
|
|
|
|
.Fn exp2f
|
|
|
|
.\" .Fn exp2f ,
|
|
|
|
.\" and
|
|
|
|
.\" .Fn exp2l
|
|
|
|
functions compute the base 2 exponential of the given argument
|
|
|
|
.Fa x .
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Fn expm1
|
2013-12-06 12:04:52 +01:00
|
|
|
and
|
2011-03-18 16:52:16 +01:00
|
|
|
.Fn expm1f
|
2013-12-06 12:04:52 +01:00
|
|
|
functions compute the value exp(x)\-1 accurately even for tiny argument
|
2011-03-18 16:52:16 +01:00
|
|
|
.Fa x .
|
|
|
|
.Sh RETURN VALUES
|
|
|
|
These functions will return the appropriate computation unless an error
|
|
|
|
occurs or an argument is out of range.
|
|
|
|
The functions
|
2013-12-06 12:04:52 +01:00
|
|
|
.Fn exp
|
2011-03-18 16:52:16 +01:00
|
|
|
and
|
2013-12-06 12:04:52 +01:00
|
|
|
.Fn expm1
|
2011-03-18 16:52:16 +01:00
|
|
|
detect if the computed value will overflow,
|
|
|
|
set the global variable
|
|
|
|
.Va errno
|
|
|
|
to
|
|
|
|
.Er ERANGE
|
|
|
|
and cause a reserved operand fault on a
|
|
|
|
.Tn VAX .
|
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr math 3
|
|
|
|
.Sh STANDARDS
|
|
|
|
The
|
2013-12-06 12:04:52 +01:00
|
|
|
.Fn exp
|
2011-03-18 16:52:16 +01:00
|
|
|
functions conform to
|
|
|
|
.St -ansiC .
|
|
|
|
The
|
|
|
|
.Fn exp2 ,
|
|
|
|
.Fn exp2f ,
|
|
|
|
.Fn expf ,
|
|
|
|
.Fn expm1 ,
|
|
|
|
and
|
2013-12-06 12:04:52 +01:00
|
|
|
.Fn expm1f
|
2011-03-18 16:52:16 +01:00
|
|
|
functions conform to
|
|
|
|
.St -isoC-99 .
|
|
|
|
.Sh HISTORY
|
2013-12-06 12:04:52 +01:00
|
|
|
The
|
|
|
|
.Fn exp
|
|
|
|
functions appeared in
|
2011-03-18 16:52:16 +01:00
|
|
|
.At v6 .
|
|
|
|
The
|
|
|
|
.Fn expm1
|
2013-12-06 12:04:52 +01:00
|
|
|
function appeared in
|
2011-03-18 16:52:16 +01:00
|
|
|
.Bx 4.3 .
|