STL
fkt.cpp File Reference
#include "fkt.h"
#include <cassert>
#include <iostream>
#include <string>
#include <vector>
Include dependency graph for fkt.cpp:

Go to the source code of this file.

Functions

double sgn (const double x)
 
float sgn (const float x)
 
size_t sgn (const string x)
 
void copy_vek (const vector< int > &a, vector< int > &b)
 
void set_value (int &a)
 
float mypow (const float x, const int k)
 

Function Documentation

◆ copy_vek()

void copy_vek ( const vector< int > &  a,
vector< int > &  b 
)

Kopiert eine Vektor auf den anderen. Der Vektor b wird bei Bedarf reallokiert.

Parameters
[in]azu kopierender Vektor
[out]bkopierter Vektor

Definition at line 56 of file fkt.cpp.

◆ mypow()

float mypow ( const float  x,
const int  k 
)

Meine eigene Powerfunktion. Rekursive Implementierung.

Parameters
[in]xreelle Zahl
[in]kganze Zahl >=0
Returns
x^k
Warning
Bricht ab falls k < 0.

Definition at line 69 of file fkt.cpp.

Here is the caller graph for this function:

◆ set_value()

void set_value ( int &  a)

Demonstration der Uebergabe via Refeerenz und Aenderung des Wertes der Variablen.

Parameters
[in,out]aZahl

Definition at line 63 of file fkt.cpp.

Here is the caller graph for this function:

◆ sgn() [1/3]

double sgn ( const double  x)

Signum-Funktion.

Parameters
[in]xdoppelt genaue reelle Zahl
Returns
Vorzeichen der Zahl (0 ==> 0)

Definition at line 9 of file fkt.cpp.

Here is the caller graph for this function:

◆ sgn() [2/3]

float sgn ( const float  x)

Signum-Funktion.

Parameters
[in]xeinfach genaue reelle Zahl
Returns
Vorzeichen der Zahl (0 ==> 0)

Definition at line 28 of file fkt.cpp.

◆ sgn() [3/3]

size_t sgn ( const string  x)

Demonstration einer weiteren Signatur mit Funktion sgn.

Parameters
[in]xstring
Returns
Laenge des strings

Definition at line 47 of file fkt.cpp.