Ah! I knew someone out there was paying attention in math class. Thanks.

<OT> The VB issue is complex. VB.Net breaks a whole lot of VB6. It will
probably break this program somewhere, but the program is for internal use
only in a software company, so we're used to broken software <g>, and
there's no reason to go to VB.Net with it unless we want to. OTOH, hopefully
there won't be any 64-bit issues. The value in question (that is, the
underlying data) will always be a 32-bit (or 31-bit, if you will) value, and
is declared as such in the program. </OT>

Charles

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[EMAIL PROTECTED] On Behalf
Of Paul Gilmartin
Sent: Wednesday, February 21, 2007 4:45 PM
To: [email protected]
Subject: Re: Simulating SRL in integer arithmetic

I think we can be more formal than empirical here.  Clearing
the sign bit of a negative number is equivalent to subtracting
2^31.  Then dividing by 2^8 yields a result biased by negative
2^23 (0x800000), which is set right by adding the bias back in.

But that algorithm will break when 64-bit Visual Basic arrives.
Perhaps similar compatibility issues are delaying the advent
of 64-bit COBOL.

----------------------------------------------------------------------
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