Abs

int abs(int x);

Funkcja abs() zwraca wartość bezwzględną liczby całkowitej (ang. integer).

Przykład


#include <iostream>
#include <math.h>

int main()
{
  std::cout << abs(-2); // program wyświetli: 2
  system("pause");
}

Zobacz też:

Informacje
Ostatnia modyfikacja 20-12-2007 15:42 Ostatni autor Coldpeer
Ilość wyświetleń 2133 Wersja 3
Komentarz

Katalog
Copyright © 2000-2006 by Coyote Group 0.9.3-pre3
Czas generowania strony: 0.0142 sek. (zapytań SQL: 9)