Please send questions to
st10@humboldt.edu .
/*--------------------------------------------------
created by st10 at Wed Mar 10 14:17:22 PST 2010
--------------------------------------------------*/
#include <iostream>
#include <cmath>
using namespace std;
/*--------------------------------------------------
Contract: abs_value : double -> double
Purpose: expects a number, and produces the
absolute value of that number
Examples: abs_value(-3) == 3
abs_value(8) == 8
abs_value(0) == 0
--------------------------------------------------*/
double abs_value(double num)
{
if (num < 0)
return -1 * num;
else
return num;
}