aboutsummaryrefslogtreecommitdiff
path: root/src/benchmarks/cfrac/pabs.c
blob: 674cf1b4eb2c1753a713216ad7b2ab06c2b76819 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include "pdefs.h"	/* private include file */
#include "precision.h"	/* public include file for forward refs */
#include <string.h>

/*
 * absolute value
 */
precision pabs(u)
   register precision u;
{
   register precision w;

   (void) pparm(u);
   w = palloc(u->size);
   if (w == pUndef) return w;

   w->sign = false;
   (void) memcpy(w->value, u->value, u->size * sizeof(digit));

   pdestroy(u);
   return presult(w);
}