1 year ago
#308532
pmor
ISO/IEC TR 18037 (fixed-point arithmetic): no signed zero?
In ISO/IEC TR 18037:2006(E) I don't see if there is a signed zero.
Consider this code:
int main(void)
{
_Sat short _Fract x, y;
x = 0.0078125HR; // SFRACT_EPSILON
y = x * x; // 0.0HR
y = -x * x; // -0.0078125HR
}
Questions:
- If anyone knows: why there is no signed zero?
- If
-x * x
is-SFRACT_EPSILON
, then whyx * x
is0.0HR
instead ofSFRACT_EPSILON
?
c
zero
fixed-point
0 Answers
Your Answer