PIPS
abs.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <limits.h>
#include "arithmetique.h"
#include "linear_assert.h"
+ Include dependency graph for abs.c:

Go to the source code of this file.

Functions

Value abs_ofl_ctrl (Value i, int ofl_ctrl)
 it seems rather stupid to trap arithmetic errors on abs... More...
 
Value absval_ofl (Value i)
 int absval_ofl(int i): absolute value of i (SUN version) More...
 
Value absval (Value i)
 int absval(int i): absolute value of i (SUN version) More...
 

Function Documentation

◆ abs_ofl_ctrl()

Value abs_ofl_ctrl ( Value  i,
int  ofl_ctrl 
)

it seems rather stupid to trap arithmetic errors on abs...

_has_yy_size_t

FC.

Parameters
ofl_ctrlfl_ctrl

Definition at line 38 of file abs.c.

39 {
40 
41  if ((ofl_ctrl == 1) && value_eq(i,VALUE_MIN))
43 
45  return value_pos_p(i)? i: value_uminus(i);
46 }
@ overflow_error
#define THROW(what)
#define value_pos_p(val)
#define value_uminus(val)
unary operators on values
#define VALUE_MIN
#define value_ne(v1, v2)
#define value_eq(v1, v2)
bool operators on values
#define assert(ex)
Definition: newgen_assert.h:41

References assert, overflow_error, THROW, value_eq, VALUE_MIN, value_ne, value_pos_p, and value_uminus.

Referenced by absval(), and absval_ofl().

+ Here is the caller graph for this function:

◆ absval()

Value absval ( Value  i)

int absval(int i): absolute value of i (SUN version)

Definition at line 58 of file abs.c.

59 {
60  return abs_ofl_ctrl(i, 0);
61 }
Value abs_ofl_ctrl(Value i, int ofl_ctrl)
it seems rather stupid to trap arithmetic errors on abs...
Definition: abs.c:38

References abs_ofl_ctrl().

+ Here is the call graph for this function:

◆ absval_ofl()

Value absval_ofl ( Value  i)

int absval_ofl(int i): absolute value of i (SUN version)

Definition at line 50 of file abs.c.

51 {
52  return abs_ofl_ctrl(i, 1);
53 }

References abs_ofl_ctrl().

+ Here is the call graph for this function: