Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.28 KB | None | 0 0
  1. /* Finished 32 bit sample to unsigned 32 bit sample. */
  2. #define CONV_SU32(s) \
  3. ( (s >= 0) \
  4.     ?   ((uint32_t)s + (uint32_t)2147483648UL) \
  5.     :   ((s == (int32_t)-2147483648UL) \
  6.         ?   0 /* Separate because negation would overflow. */  \
  7.         :   (uint32_t)2147483648UL - (uint32_t)(-s) ) \
  8. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement