kennen:lib:labs
Inhaltsverzeichnis
labs()
#include <cstdlib>
#include <cmath>
long int labs (long int zahl)
Liefert den Absolutbetrag von zahl.
Parameter
zahl | Ganzzahlwert |
Ergebnis
Rückgabewert: zahl für zahl>=0, sonst -zahl.
Siehe auch
Beispiel
- labs.cpp
#include <cstdlib> #include <iostream> int main() { long int i = -1234567890; std::cout << "Betrag von " << i << " = " << std::labs(i) << '\n'; }
kennen/lib/labs.txt · Zuletzt geändert: von 127.0.0.1
