-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsat_ops.h
33 lines (21 loc) · 798 Bytes
/
sat_ops.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/////////////////////////////////////////
// uncomment only one of the following pairs of typedefs at a time
//typedef signed char mysint;
//typedef unsigned char myuint;
//typedef signed short mysint;
//typedef unsigned short myuint;
typedef signed int mysint;
typedef unsigned int myuint;
//typedef signed long int mysint;
//typedef unsigned long int myuint;
//////////////////////////////////////////
// you are implementing these four functions
// saturating unsigned addition
myuint sat_unsigned_add (myuint, myuint);
// saturating unsigned subtraction
myuint sat_unsigned_sub (myuint, myuint);
// saturating signed addition
mysint sat_signed_add (mysint, mysint);
// saturating signed subtraction
mysint sat_signed_sub (mysint, mysint);
//////////////////////////////////////////