(1 / 3)
Date: February 04, 1987 13:01
From: KIM::MARGOLIN
To: SHEPPERD,MARGOLIN
Dave, Please try the following: WRITE SYS$OUTPUT %XFF439EB1/%X10000 WRITE SYS$OUTPUT %XFFFFFF43 Jed
(2 / 3)
Date: February 04, 1987 13:32
From: KIM::SHEPPERD
To: MARGOLIN,SHEPPERD
So?
%XFF439EB2 = -12345678.
%X10000 = 65536.
-12345678/65536 = -188.38 in either Hex or Decimal
%XFFFFFF43 = -189.00 in either radix.
Conclusion: %XFF430000 is not equal to %XFF439EB2.
Dividing is not the same as and will not produce the same result as shifting
right. It looks as though you wanted to (-12345678. & -65536.)/65536. which is
the only way you can make sure a shift and divide will produce the same result.
If, on the other hand, you wanted a result in Hex, you should have used FAO:
write sys$output fao("!XL",%XFF439EB2/%X10000)
ds
(3 / 3)
Date: February 04, 1987 13:37
From: KIM::MARGOLIN
To: KIM::SHEPPERD,MARGOLIN
Aha. Thank you. Jed
Feb 04, 1987