× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Steve Richter wrote:
I have a 170 with 460 cpw.  But that should not matter, all the results are
relative to the same system.  Bin to bin is 15% faster than int to int.  Add
to bin is off the charts, 20x slower than add to int.

I would like to know if the rpg definition of "Binary" is unique to it and
if it predates the s/38.   And was the as400 database handling of binary
something forced on it by RPG?


Time again for a history lesson, eh?


Let's go back to RPG II, as implemented on machines like the S/34. RPG II only had zoned decimal numeric as the internal representation for numerics. (Externally, it supported a bunch of other formats, like packed and binary decimal, left/right signed, etc.)

RPG III on the S/38 added binary decimal and packed decimal as internal numeric formats, and made them work exactly the same as zoned decimal. (Call all three the "decimal" formats.) It did this by implicitly converting binary and zoned values to packed before all arithmetic.

As far as DDS is concerned, "binary" can hold 2, 4, or 8 byte two's complement values. RPG is the odd one out since it maps DDS's "B" format into RPG's "B" format. Clearly, that's not always the best match, and never was.

RPG IV added (eventually) three other numeric formats: float, integer, and unsigned, each with its own unique set of characteristics. As is true with most CPU's, the iSeries implements arithmetic fastest in binary, and so RPG's integer and unsigned formats are the fastest for arithmetic. For compatibility, RPG IV had to continue to map the "B" format in DDS to RPG's "B" format. Thus, the EXTBININT keyword is needed to tell the compiler to break compatibility, and do the right thing instead.

Cheers! Hans


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.