📄 function.html
字号:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD W3 HTML 2.0//EN">
<HTML lang="en-US">
<HEAD>
<TITLE>function</TITLE>
<META name="description"
content="Definition of function,
possibly with links to more information and implementations.">
<META name="keywords" content="function">
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<H1>function</H1>
<P>
(definition)
<P>
<strong>Definition:</strong>
(1) A computation which takes some arguments or inputs and yields an output. Any particular input yields the same output every time. More formally, a mapping from each element in the <a href="domain.html" tppabs="http://hissa.nist.gov/dads/HTML/domain.html"><em>domain</em></a> to an element in the <a href="range.html" tppabs="http://hissa.nist.gov/dads/HTML/range.html"><em>range</em></a>. (2) A subroutine which returns a value.
<P><strong>See also</strong>
<a href="relation.html" tppabs="http://hissa.nist.gov/dads/HTML/relation.html"><em>relation</em></a>, <a href="totalfunc.html" tppabs="http://hissa.nist.gov/dads/HTML/totalfunc.html"><em>total function</em></a>, <a href="booleanfnctn.html" tppabs="http://hissa.nist.gov/dads/HTML/booleanfnctn.html"><em>boolean function</em></a>, <a href="constantfunc.html" tppabs="http://hissa.nist.gov/dads/HTML/constantfunc.html"><em>constant function</em></a>, <a href="unaryfunc.html" tppabs="http://hissa.nist.gov/dads/HTML/unaryfunc.html"><em>unary function</em></a>, <a href="binaryfunc.html" tppabs="http://hissa.nist.gov/dads/HTML/binaryfunc.html"><em>binary function</em></a>, <a href="trinaryfunc.html" tppabs="http://hissa.nist.gov/dads/HTML/trinaryfunc.html"><em>trinary function</em></a>, <a href="naryfunc.html" tppabs="http://hissa.nist.gov/dads/HTML/naryfunc.html"><em>n-ary function</em></a>, <a href="procedure.html" tppabs="http://hissa.nist.gov/dads/HTML/procedure.html"><em>procedure</em></a>.
<P><em>Note:
(1) A relation may map an input to more than one output. Every function is a relation. The inverse of a function, a mapping from the function's outputs to its inputs, may be a relation rather than another function. <P> Consider <img src="sqrt.gif" tppabs="http://hissa.nist.gov/dads/HTML/Images/sqrt.gif" border=0 height=15 width=12 alt="square root of">(x). The domain and the range are the nonnegative real numbers, <strong><em>R</em></strong><sup>0+</sup>. For instance 4 is mapped to 2. The inverse is the function x<sup>2</sup>, which maps 2 to 4. Cosine is also a function, since every angle has a specific cosine, but its inverse cos<sup>-1</sup>(x) is a relation, since a cosine value maps to many (for cosine, infinitely many) angles. <P> A function which takes no arguments is a constant function, or simply, a constant. Since a function must return the same value for each input and the input cannot change (since it has no arguments), it must always return the same value. For instance, if the function one() always returns 1, we can use it instead of the constant 1. This is theoretical convenient because we can write everything as functions, rather than functions and constants. <P> (2) A subroutine which does not return a value is called a "procedure" in some programming languages.</em>
<P>Author: <a href="terms.html#authorPEB" tppabs="http://hissa.nist.gov/dads/terms.html#authorPEB">PEB</a>
<hr>
Go to the
<A HREF="terms.html" tppabs="http://hissa.nist.gov/dads/terms.html">Algorithms, Data Structures, and Problems</A>
home page.
<hr>
If you have suggestions, corrections, or comments, please get in touch
with
<a href="javascript:if(confirm('http://hissa.nist.gov/~black/black.html \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://hissa.nist.gov/~black/black.html'" tppabs="http://hissa.nist.gov/~black/black.html">Paul E. Black</a>
(<a href="mailto:paul.black@nist.gov">paul.black@nist.gov</a>).
<p>
Entry modified Wed Aug 4 10:57:18 1999.<BR>
HTML page formatted Wed Dec 22 09:35:25 1999.
<P>
This page's URL is
<A href="function.html" tppabs="http://hissa.nist.gov/dads/HTML/function.html">http://hissa.nist.gov/dads/HTML/function.html</A>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -