Namespaces
Variants
Views
Actions

Difference between revisions of "cpp/numeric/math/exp2"

From cppreference.com
< cpp‎ | numeric‎ | math
(Created page with "'''std::exp2''' Defined in header <cmath> float exp2( float arg ); double exp2( double arg ); long double exp2( long double arg ); Compu...")
 
(formatting)
Line 1: Line 1:
'''std::exp2'''
+
{{cpp/title|exp2}}
 +
{{cpp/numeric/math/sidebar}}
 +
{{ddcl list begin}}
 +
{{ddcl list header | cmath}}
 +
{{ddcl list item | notes={{mark c++11 feature}} |
 +
double      exp2( double n );
 +
}}
 +
{{ddcl list item | notes={{mark c++11 feature}} |
 +
float      exp2( float n );
 +
}}
 +
{{ddcl list item | notes={{mark c++11 feature}} |
 +
long double exp2( long double n );
 +
}}
 +
{{ddcl list end}}
  
Defined in header <cmath>   
+
Computes 2 raised to the given power {{tt|n}}
+
+
float      exp2( float arg ); 
+
+
+
double      exp2( double arg ); 
+
+
+
long double exp2( long double arg ); 
+
+
+
  
Computes 2 raised to the given power arg
+
===Parameters===
 +
{{param list begin}}
 +
{{param list item | n | floating point value}}
 +
{{param list end}}
  
'''Parameters'''
+
===Return value===
arg  -  floating point value
+
  
'''Return value'''
+
2 raised to the {{tt|n}} (i.e. {{tt|2<sup>n</sup>}})
2 raised to the power arg
+
  
 
If the result is too large for the underlying type, range error occurs and HUGE_VAL is returned.  
 
If the result is too large for the underlying type, range error occurs and HUGE_VAL is returned.  
  
'''See also'''
+
===See also===
+
 
[log] [http://en.cppreference.com/w/cpp/numeric/math/log]
+
{{dcl list begin}}
computes natural (base e) logarithm (to base e) (ln(x))
+
{{dcl list template | cpp/numeric/math/dcl list exp}}
(function)
+
{{dcl list template | cpp/numeric/math/dcl list log}}
+
{{dcl list template | cpp/numeric/math/dcl list pow}}
[pow][http://en.cppreference.com/w/cpp/numeric/math/pow
+
{{dcl list end}}
raises a number to the given power (x<y>)
+
(function)
+

Revision as of 04:42, 28 October 2011

Template:cpp/numeric/math/sidebar Template:ddcl list begin <tr class="t-dsc-header">

<td>
Defined in header <cmath>
</td>

<td></td> <td></td> </tr> <tr class="t-dcl ">

<td >
double      exp2( double n );
</td>

<td class="t-dcl-nopad"> </td> <td > Template:mark c++11 feature </td> </tr> <tr class="t-dcl ">

<td >
float       exp2( float n );
</td>

<td class="t-dcl-nopad"> </td> <td > Template:mark c++11 feature </td> </tr> <tr class="t-dcl ">

<td >
long double exp2( long double n );
</td>

<td class="t-dcl-nopad"> </td> <td > Template:mark c++11 feature </td> </tr> Template:ddcl list end

Computes 2 raised to the given power n

Parameters

n - floating point value

Return value

2 raised to the n (i.e. 2n)

If the result is too large for the underlying type, range error occurs and HUGE_VAL is returned.

See also

Template:cpp/numeric/math/dcl list expTemplate:cpp/numeric/math/dcl list logTemplate:cpp/numeric/math/dcl list pow