1 <?xml version=
"1.0" encoding=
"UTF-8" standalone=
"no"?>
2 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns=
"http://www.w3.org/1999/xhtml"><head><meta http-equiv=
"Content-Type" content=
"text/html; charset=UTF-8" /><title>Chapter
36. Numerics
</title><meta name=
"generator" content=
"DocBook XSL Stylesheets V1.73.2" /><meta name=
"keywords" content=
" ISO C++ , library " /><link rel=
"start" href=
"../spine.html" title=
"The GNU C++ Library Documentation" /><link rel=
"up" href=
"extensions.html" title=
"Part XII. Extensions" /><link rel=
"prev" href=
"bk01pt12ch35.html" title=
"Chapter 35. Algorithms" /><link rel=
"next" href=
"bk01pt12ch37.html" title=
"Chapter 37. Iterators" /></head><body><div class=
"navheader"><table width=
"100%" summary=
"Navigation header"><tr><th colspan=
"3" align=
"center">Chapter
36. Numerics
</th></tr><tr><td width=
"20%" align=
"left"><a accesskey=
"p" href=
"bk01pt12ch35.html">Prev
</a> </td><th width=
"60%" align=
"center">Part XII. Extensions
</th><td width=
"20%" align=
"right"> <a accesskey=
"n" href=
"bk01pt12ch37.html">Next
</a></td></tr></table><hr /></div><div class=
"chapter" lang=
"en" xml:
lang=
"en"><div class=
"titlepage"><div><div><h2 class=
"title"><a id=
"manual.ext.numerics"></a>Chapter
36. Numerics
</h2></div></div></div><p>26.4, the generalized numeric operations such as accumulate, are extended
4 with the following functions:
5 </p><pre class=
"programlisting">
7 power (x, n, moniod_operation);
</pre><p>Returns, in FORTRAN syntax,
"x ** n" where n
>=
0. In the
8 case of n ==
0, returns the
<a class=
"ulink" href=
"#ch20" target=
"_top">identity element
</a> for the
9 monoid operation. The two-argument signature uses multiplication (for
10 a true
"power" implementation), but addition is supported as well.
11 The operation functor must be associative.
12 </p><p>The
<code class=
"code">iota
</code> function wins the award for Extension With the
13 Coolest Name. It
"assigns sequentially increasing values to a range.
14 That is, it assigns value to *first, value + 1 to *(first + 1) and so
15 on." Quoted from SGI documentation.
16 </p><pre class=
"programlisting">
17 void iota(_ForwardIter first, _ForwardIter last, _Tp value);
</pre></div><div class=
"navfooter"><hr /><table width=
"100%" summary=
"Navigation footer"><tr><td width=
"40%" align=
"left"><a accesskey=
"p" href=
"bk01pt12ch35.html">Prev
</a> </td><td width=
"20%" align=
"center"><a accesskey=
"u" href=
"extensions.html">Up
</a></td><td width=
"40%" align=
"right"> <a accesskey=
"n" href=
"bk01pt12ch37.html">Next
</a></td></tr><tr><td width=
"40%" align=
"left" valign=
"top">Chapter
35. Algorithms
</td><td width=
"20%" align=
"center"><a accesskey=
"h" href=
"../spine.html">Home
</a></td><td width=
"40%" align=
"right" valign=
"top"> Chapter
37. Iterators
</td></tr></table></div></body></html>