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

Bug#362414: abs() returns a negative number



* Martin Michlmayr <tbm@cyrius.com> [2006-04-13 18:58]:
> > isn't -27260928 the smallest negative number for int?
> I don't think so, no.

Anyway, if you put some printfs in the code you'll see that the
problems occurs for many cases, e.g.:

abs (2083755264 + abs (abs (79364096) - 256))
-2131848192 (data[k] = 79364096)
abs (-2131848192 + abs (abs (75497472) - 256))
-2056350976 (data[k] = 75497472)
abs (-2056350976 + abs (abs (80019456) - 256))
-1976331776 (data[k] = 80019456)
abs (-1976331776 + abs (abs (76349440) - 256))
-1899982592 (data[k] = 76349440)
abs (-1899982592 + abs (abs (79822848) - 256))
-1820160000 (data[k] = 79822848)

-- 
Martin Michlmayr
http://www.cyrius.com/



Reply to: