From REXX/VM Reference -
<Quote>
Certain character strings are numbers even though they do not appear to be numeric to the user. Specifically, because of the format of numbers in exponential notation, strings, such as 0E123 (0 raised to the 123 power) and 1E342 (1 raised to the 342 power), are numeric. In addition, a comparison such as 0E123=0E567 gives a true result of 1 (0 is equal to 0). To prevent problems when comparing nonnumeric strings, use the strict comparison operators. </Quote>


Thomas Berg wrote:
-----Ursprungligt meddelande-----
Från: IBM Mainframe Discussion List [mailto:[EMAIL PROTECTED] För Patrick O'Keefe
Skickat: den 10 mars 2008 20:50
Till: IBM-MAIN@BAMA.UA.EDU
Ämne: Re: Rexx bug?
On Mon, 10 Mar 2008 19:16:26 +0000, Ted MacNEIL <[EMAIL PROTECTED]> wrote:
The simple answer is that the designed the interpreter that way.
Whenever possible numeric strings are interpreted as numbers first, unless you perform unnatural acts of coding, regardless of whether you quote it or not.
While I've known this for years, I've never given it much thought.
I've been coding REXX since around 1988 but never (knowingly) ran
into this ... probably because I've never needed to use scientific
notiation in REXX and never even knew it was supported.   I now
wonder how many comparisons are waiting to fail on me. I can just picture very different and unexpected results from the two
invocations
  x= SOMEEXEC(00E0 00E8)
  y= SOMEEXEC(00F0 00F8)
where REXX sees 2 equal numbers in the first case and 2 different strings in the second case.

No.  REXX sees 1 string in each case ("00E0 00E8" and "00F0 00F8").
Try  x = 00E0 + 00E8  and  y = 00F0 + 00F8
You will get an error in the latter case.


Regards,
Thomas Berg
_____________________________________________________________
Thomas Berg Specialist IT Utveckling Swedbank AB (Publ)
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html
..
For: [EMAIL PROTECTED]




--
Chris Langford,
Cestrian Software:
Consulting services for: VM, VSE, MVS, z/VM, z/OS, OS/2, P/3x0 etc.
    z/FM  - A toolbox for VM & MVS at http://zfm.cestrian.com

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to