Guest User

Untitled

a guest
Jan 19th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.19 KB | None | 0 0
  1. inline int16_t adds(int16_t a, int16_t b){
  2. int32_t res = (int32_t)a + (int32_t)b;
  3. if (res > 32767) return 32767;
  4. if (res < -32768) return -32678;
  5. return (int16_t)res;
  6. }
Add Comment
Please, Sign In to add comment