[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#362414: abs() returns a negative number



* Nikita V. Youshchenko <yoush@debian.org> [2006-04-14 10:55]:
> >     sum_abs = abs (sum_abs + abs (abs (data [k]) - 256)) ;
> > 
> Looks like you are working near limits of 'int' type, and different
> valid optimizations could change order of calculation, either
> causing data overflow or not. Try using long long instead of int.

Just changing sum_abs to long doesn't help.
-- 
Martin Michlmayr
http://www.cyrius.com/



Reply to: