Not solving it, but it probably has to be fabs rather than abs. abs is casting to integers I think