Quantcast
Channel: IBM Mainframe Computers Forums
Viewing all articles
Browse latest Browse all 9405

PL/I & Assembler :: RE: Zerodivide raised when divisor is 0.01

$
0
0
Author: prino
Subject: Re: Zerodivide raised when divisor is 0.01
Posted: Wed May 11, 2016 12:58 pm (GMT 5.5)

soundarr wrote:
Dear All,

Strangely, I get a zerodivide error condition raised for the below statement. Can you please confirm if 0.01 is not accepted by the DIVIDE function or if I am missing something.

Code:

DCL A FIXED(15,9) INIT(0);
DCL B FIXED(15,2) INIT(0);
DCL C FIXED(15,2) INIT(0);

B = 10;
C = 0.01;

A = DIVIDE(B,C,15,9);



It works if C is 0.02.

The above code compiles and executes flawlessly with
  • OS PL/I V2.3.0
  • Enterprise PL/I V3.3
  • Enterprise PL/I V3.5
  • Enterprise PL/I V3.7
  • Enterprise PL/I V3.9
  • Enterprise PL/I V4.3
Ergo conclusio: You're talking utter BS. Your zerodivide occurs somewhere else! The arrogant imbecility of assuming that c=0.01 would cause it is breathtaking.
_________________
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
No programming here icon_smile.gif


Viewing all articles
Browse latest Browse all 9405

Trending Articles