#include <cmath>
#include
double exp2 (double x)
Liefert $2^x$.
x
Rückgabewert: Potenz $2^x$.
Bei zu großem x tritt ein Bereichsfehler auf (errno = ERANGE).
= ERANGE
log2(), pow().
#include <cmath> #include <iostream> int main() { std::cout << "2^10 = " << std::exp2(10.0) << '\n'; }