different behavior of abs() in c and cpp