Open rvjansen opened 2 years ago
Comment by Kermit Kiser [ 13/Jul/15 ] Please clarify what is being requested. There is a section (43) in the NetRexx Language Reference manual which describes binary operations. Section 42.2.11 describes the NetRexx divide by zero exception. Java (ie binary mode) allows floating point divide by zero without exception but gives ArithmeticException with integers. Here is the related NRL (section 43.1) excerpt: Note that NetRexx provides both divide and integer divide operators; in a binary class or method, the divide operator (”/”) converts its operands to floating-point types and returns a floating-point result, whereas the integer divide operator (”%”) converts its operands to integer types and returns an integer result.
The following script illustrates the expected results:
do – nobinary
say "nobinary 1/0 ="
say 1/0
catch de=DivideException say de
end
do – nobinary
say "nobinary 1%0 ="
say 1%0
catch de=DivideException
say de end
do binary
say "binary 1/0 =" say 1/0
end
do binary
say "binary 1%0 = NetRexx compile error" – say 1%0 "NetRexx compile error"
end
do binary
x=int(1)
y=int(0)
say "binary x%y (x=1, y=0) =" say x%y
catch ae=ArithmeticException say ae
end
1/0 raises no exception with binary and these:
(Walter Pachl)