CARM User's Guide

Discontinued

fabs

Summary
#include <math.h>

double fabs (
  double val);   /* number to take absolute value of */
Description

The fabs function determines the absolute value of the floating-point number val.

Return Value

The fabs function returns the absolute value of val.

See Also

abs, labs

Example
#include <math.h>
#include <stdio.h> /* for printf */

void tst_fabs (void) {
  float x;
  float y;

  x = 10.2;
  y = fabs (x);
  printf ("FABS(%f) = %f\n", x, y);

  x = -3.6;
  y = fabs (x);
  printf ("FABS(%f) = %f\n", x, y);
}