PL/1 - Negative Zero
Page 1 of 1
PL/1 - Negative Zero
We are facing problem when migrating to Enterprise PL/1. Do you have any migration rule book?
DCL IN_FLD PIC’(6)9’;
DCL IN_SIGN CHAR(1);
DCL OUT_FLD FIXED DEC(7);
OUT_FLD = IN_FLD;
IF IN_SIGN = ‘-‘ THEN
DO;
OUT_FLD = OUT_FLD*(-1);
END;
In Case IN_FLD is 0 ( Zero) with IN_SIGN = ‘-‘, the OUT_FLD is having result as 0 (Zero) with Enterprise Compiler. With Old Compiler, Results are -0 or X(0C) . We have changed the compiler options to “FORCEDSIGN” but results are without Negative Sign. This is working fine for other Numeric Values.
Please provide your thoughts.
DCL IN_FLD PIC’(6)9’;
DCL IN_SIGN CHAR(1);
DCL OUT_FLD FIXED DEC(7);
OUT_FLD = IN_FLD;
IF IN_SIGN = ‘-‘ THEN
DO;
OUT_FLD = OUT_FLD*(-1);
END;
In Case IN_FLD is 0 ( Zero) with IN_SIGN = ‘-‘, the OUT_FLD is having result as 0 (Zero) with Enterprise Compiler. With Old Compiler, Results are -0 or X(0C) . We have changed the compiler options to “FORCEDSIGN” but results are without Negative Sign. This is working fine for other Numeric Values.
Please provide your thoughts.
kasthuri- Posts : 212
Join date : 2013-01-27
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|