60inline uint32_t
fp_rndu(uint32_t Q, uint_fast8_t n)
63 else if (n > 32U)
return 0;
68 return (Q >> 1) + (Q & 1U);
80inline int32_t
fp_rnds(int32_t Q, uint_fast8_t n)
82 return (Q < 0) ? -(int32_t)
fp_rndu((uint32_t)(-Q), n) : (int32_t)
fp_rndu((uint32_t)Q, n);
94inline uint32_t
fp_truncu(uint32_t Q, uint_fast8_t n)
96 return (n < 32U) ? (Q >> n) : 0;
110 return (Q < 0) ? -(int32_t)
fp_truncu((uint32_t)(-Q), n) : (int32_t)
fp_truncu((uint32_t)Q, n);
This file is part of the AFBR-S50 API.
uint32_t fp_rndu(uint32_t Q, uint_fast8_t n)
Converting with rounding from UQx.n1 to UQx.n2.
Definition fp_rnd.h:60
int32_t fp_truncs(int32_t Q, uint_fast8_t n)
Converting with truncation from Qx.n1 to Qx.n2.
Definition fp_rnd.h:108
uint32_t fp_truncu(uint32_t Q, uint_fast8_t n)
Converting with truncation from UQx.n1 to UQx.n2.
Definition fp_rnd.h:94
int32_t fp_rnds(int32_t Q, uint_fast8_t n)
Converting with rounding from Qx.n1 to Qx.n2.
Definition fp_rnd.h:80