Re: SV: Rexx bug?
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 +, 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
Re: SV: Rexx bug?
In the category you can't always believe what you read in the manual, 0E123 is 0 times 10 to the 123 power, and 1E342 is 1 times 10 to the 342 power. Mark Wheeler, 3M Company Chris Langford [EMAIL PROTECTED] OMTo Sent by: IBM IBM-MAIN@BAMA.UA.EDU Mainframe cc Discussion List [EMAIL PROTECTED] Subject .EDU Re: SV: Rexx bug? 03/11/2008 09:32 AM Please respond to IBM Mainframe Discussion List [EMAIL PROTECTED] .EDU 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 +, 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 -- 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
Re: SV: Rexx bug?
On Tue, 11 Mar 2008 15:09:45 +0100, Thomas Berg [EMAIL PROTECTED] wrote: ... ... 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. ... Ok. I worded that very poorly. Assuming that the exec is going to parse its parm string into hex arguments, it had better take care to handle those args as strings wherever they might be misconstrued as numbers. I know I have not done that since I never thought about scientific notation. I didn't know REXX supported it. Pat O'Keefe -- 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