abs
Syntax:
#include <stdlib.h> int abs( int num ); The abs() function returns the absolute value of num. For example: int magic_number = 10; cout << "Enter a guess: "; cin >> x; cout << "Your guess was " << abs( magic_number - x ) << " away from the magic number." << endl; |
#include <math.h> double acos( double arg );
The acos() function returns the arc cosine of arg, which will be in the range [0, pi]. arg should be between -1 and 1. If arg is outside this range, acos() returns NAN and raises a floating-point exception.