Fungsi Logaritmik

29
abs double abs ( double x ); float abs ( float x ); long double abs ( long double x ); <cmath> Compute absolute value Returns the absolute value of x ( /x/ ). In C++, this function is overloaded in <cstdlib> , <complex> and <valarray> (see cstdlib abs , complex abs and valarray abs ). Parameters x Floating point value. Return Value The absolute value of x. Portability These overloads of abs are only available in C++. In C, only the cstdlib version of exists (see cstdlib abs ) - fabs can be used instead. Example // cmath's abs example #include <iostream> #include <cmath> using namespace std; int main () { cout << "The absolute value of 3.1416 is " << abs (3.1416) << endl; cout << "The absolute value of -10.6 is " << abs (-10.6) << endl; return 0; }

description

Logaritmik

Transcript of Fungsi Logaritmik

abs double abs ( double x );

float abs ( float x );

long double abs ( long double x );

Compute absolute valueReturns the absolute value of x ( /x/ ).

In C++, this function is overloaded in , and (see cstdlib abs, complex abs and valarray abs).

Parameters

x

Floating point value.

Return Value

The absolute value of x.

Portability

These overloads of abs are only available in C++.In C, only the cstdlib version of exists (see cstdlib abs) - fabs can be used instead.

Example

// cmath's abs example

#include

#include

using namespace std;

int main ()

{

cout