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