Re: [Bulk] Re: C vs C++
Mark S Waterbury <[email protected]>
| Newsgroups | gmane.comp.lang.as400.c |
|---|---|
| Message-ID | <[email protected]> |
Jevgeni: Some historical background might help ... EPM SAA C/400 was fist available with OS/400 V1R3, circa 1990 or 1991 ... it did not support the packed decimal data type directly. ILE C/400 was first introduced with V2R3, circa 1993, and supported packed decimal data as a "native" data type right from the start. C++ was not available on the AS/400 for several more years, and even then, when it was first available, the IBM VisualAge C++ for OS/400 compiler ran only on OS/2... it was not for several more years after that before there was a "native" C++ compiler that actually ran on OS/400. Also, IBM's C++ compilers have never supported packed decimal as a native data type, but only via the BCD library, on any platforms, AFAIK. Regards, Mark S. Waterbury > On 2/18/2015 4:32 AM, Jevgeni Astanovski wrote: > What I saw in my tests is that whatever approach you use in an attempt > to convert packed decimal in C++ to something "faster" (tried > __dectoi, QXXPTOI, cpynv) the result is exactly the same as if I make > a plain assignment of packed decimal variable value to integer (or > long long) value. So these functions provide no work around. > And at the same time I saw that ANY operation with packed decimal (or > as they call it BCD) is extremely expensive in terms of performance. > At the same time in C plain assignment is absolutely fastest of all > the ways to convert packed to int. > > In this situation there are 2 things that surprise me: > 1. Why IBM decided not to use the same engine for packed decimal in C > as they use in C++? What was the trade off? I mean did they gain > anything by loosing so much in performance? > 2. How did it happen that noone have mentioned that earlier (at least > I googled and found no evidence that anyone new about it)? > > But these questions can potentially be answered only by "insiders", I > suppose.... > > > > -- This is the Bare Metal Programming IBM i (AS/400 and iSeries) (C400-L) mailing list To post a message email: C400-L-Zwy7GipZuJhWk0Htik3J/[email protected] To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/c400-l or email: C400-L-request-Zwy7GipZuJhWk0Htik3J/[email protected] Before posting, please take a moment to review the archives at http://archive.midrange.com/c400-l.