O
Oliver Block
Hi everybody,
using the following code leads to unclean result of sum() function:
/* va is a nxn array (valarray<int> (0,n*n) ) filled with integers 1 ..
5 */
int sum = 0;
for(int i = 0; i < n; i++) {
std::valarray<int> col = va[std::slice(i*n, n, n)];
cout << "sum: " << col.sum();
}
This leads to results like 14993885 even if the maximum should be 15
I have no clue what the problem might be.
I using a SuSE Linux Box with gcc 3.3 (as far as I remember the
version).
bye,
oliver
using the following code leads to unclean result of sum() function:
/* va is a nxn array (valarray<int> (0,n*n) ) filled with integers 1 ..
5 */
int sum = 0;
for(int i = 0; i < n; i++) {
std::valarray<int> col = va[std::slice(i*n, n, n)];
cout << "sum: " << col.sum();
}
This leads to results like 14993885 even if the maximum should be 15
I have no clue what the problem might be.
I using a SuSE Linux Box with gcc 3.3 (as far as I remember the
version).
bye,
oliver