xref: /netbsd-src/lib/libm/man/pow.3 (revision aa79da576759a67850ca678a04e74539390a88fc)
1*aa79da57Swiz.\" $NetBSD: pow.3,v 1.4 2024/01/26 23:41:55 wiz Exp $
2a6e1d3b2Sjruoho.\"
3a6e1d3b2Sjruoho.\" Copyright (c) 2011 Jukka Ruohonen <jruohonen@iki.fi>
4a6e1d3b2Sjruoho.\" All rights reserved.
5a6e1d3b2Sjruoho.\"
6a6e1d3b2Sjruoho.\" Redistribution and use in source and binary forms, with or without
7a6e1d3b2Sjruoho.\" modification, are permitted provided that the following conditions
8a6e1d3b2Sjruoho.\" are met:
9a6e1d3b2Sjruoho.\" 1. Redistributions of source code must retain the above copyright
10a6e1d3b2Sjruoho.\"    notice, this list of conditions and the following disclaimer.
11a6e1d3b2Sjruoho.\" 2. Redistributions in binary form must reproduce the above copyright
12a6e1d3b2Sjruoho.\"    notice, this list of conditions and the following disclaimer in the
13a6e1d3b2Sjruoho.\"    documentation and/or other materials provided with the distribution.
14a6e1d3b2Sjruoho.\"
15a6e1d3b2Sjruoho.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
16a6e1d3b2Sjruoho.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
17a6e1d3b2Sjruoho.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
18a6e1d3b2Sjruoho.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
19a6e1d3b2Sjruoho.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20a6e1d3b2Sjruoho.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21a6e1d3b2Sjruoho.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22a6e1d3b2Sjruoho.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23a6e1d3b2Sjruoho.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24a6e1d3b2Sjruoho.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25a6e1d3b2Sjruoho.\" POSSIBILITY OF SUCH DAMAGE.
26a6e1d3b2Sjruoho.\"
27*aa79da57Swiz.Dd January 24, 2024
28a6e1d3b2Sjruoho.Dt POW 3
29a6e1d3b2Sjruoho.Os
30a6e1d3b2Sjruoho.Sh NAME
31a6e1d3b2Sjruoho.Nm pow ,
327690962aSnros.Nm powf ,
337690962aSnros.Nm powl
34a6e1d3b2Sjruoho.Nd power functions
35a6e1d3b2Sjruoho.Sh LIBRARY
36a6e1d3b2Sjruoho.Lb libm
37a6e1d3b2Sjruoho.Sh SYNOPSIS
38a6e1d3b2Sjruoho.In math.h
39a6e1d3b2Sjruoho.Ft double
40a6e1d3b2Sjruoho.Fn pow "double x" "double y"
41a6e1d3b2Sjruoho.Ft float
42a6e1d3b2Sjruoho.Fn powf "float x" "float y"
437690962aSnros.Ft long double
447690962aSnros.Fn powl "long double x" "long double y"
45a6e1d3b2Sjruoho.Sh DESCRIPTION
46a6e1d3b2SjruohoThe
47a6e1d3b2Sjruoho.Fn pow
48455c3673Swizfamily of functions returns
49a6e1d3b2Sjruoho.Fa x
50a6e1d3b2Sjruohoraised to the power of
51a6e1d3b2Sjruoho.Fa y .
52a6e1d3b2Sjruoho.Pp
53a6e1d3b2SjruohoIf
54a6e1d3b2Sjruoho.Fa x
55a6e1d3b2Sjruohois negative and
56a6e1d3b2Sjruoho.Fa y
57a6e1d3b2Sjruohois not an integer, the global variable
58a6e1d3b2Sjruoho.Va errno
59a6e1d3b2Sjruohois set to
60a6e1d3b2Sjruoho.Er EDOM ,
61a6e1d3b2Sjruohoand on
62a6e1d3b2Sjruoho.Tn VAX
63a6e1d3b2Sjruohoa reserved operand fault is generated.
64a6e1d3b2SjruohoA portable application should nevertheless ensure that
65a6e1d3b2Sjruoho.Fa y
66a6e1d3b2Sjruohois an integer value whenever
67a6e1d3b2Sjruoho.Fa x
68a6e1d3b2Sjruohois negative.
69a6e1d3b2Sjruoho.Sh RETURN VALUES
70a6e1d3b2Sjruoho.\"
71a6e1d3b2Sjruoho.\" XXX: List also the special return values?
72a6e1d3b2Sjruoho.\"
73a6e1d3b2SjruohoUpon successful completion, the described functions return
74a6e1d3b2Sjruoho.Fa x^y .
75a6e1d3b2Sjruoho.Sh SEE ALSO
76a6e1d3b2Sjruoho.Xr exp 3 ,
77a6e1d3b2Sjruoho.Xr log 3
78a6e1d3b2Sjruoho.Sh STANDARDS
79a6e1d3b2SjruohoThe described functions conform to
80a6e1d3b2Sjruoho.St -isoC-99 .
81a6e1d3b2Sjruoho.Sh HISTORY
82a6e1d3b2SjruohoThe history of the power functions dates back to
83a6e1d3b2Sjruoho.At v6 .
84