🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.arch
Article #21740

IEEE 754 "rem" query

#21740
From: Richard A. O'Keefe
Date: Fri, 15 Dec 1989 01:56
18 lines
1566 bytes
I have read the IEEE 754 and IEEE 854 standards as carefully as I can,
and it is not clear to me what the sign of x REM y should be when x=0.
x REM y is "defined ... by the mathematical relation r = x - y.n"
in section 5.1.  If we thought of this as involving an subtraction in
the implementation, section 6.3's rule that "when the sum of two operands
with opposite signs (or the difference of two operands with like signs)
is exactly zero, the sign of that sum (or difference) shall be "+" in
all rounding modes except round towards -oo, in which mode that sign 
shall be "-".  However, x+x = x-(-x) retains the same sign as x even
when x is zero."  This would mean that the sign of -0.0 REM y might be
"+" or "-" depending on the sign of "y.n".  However, (a) the sign of y.n
is not defined because this is a mathematical multiplication, not an IEEE
one, and (b) if we took this reading the result of (-0.0 REM y) would
depend on the rounding mode, and x REM y is "defined regardless of the
rounding mode".

I think the result of (-0.0 REM y) should be -0.0 for any non-zero y, and
that's what I get when I try it, but is that the intent of the standard?
Technical Details
Message-ID: <1291@quintus.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!sun-barr!newstop!sun!quintus!ok

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!sun-barr!newstop!sun!quintus!ok
From: ok@quintus.UUCP (Richard A. O'Keefe)
Newsgroups: comp.arch
Subject: IEEE 754 "rem" query
Keywords: remainder, -zero
Message-ID: <1291@quintus.UUCP>
Date: 15 Dec 89 01:56:21 GMT
Reply-To: ok@quintus.UUCP (Richard A. O'Keefe)
Organization: Quintus Computer Systems, Inc.
Lines: 18