I'm using the abs() function in a probability calculation using float and int variables however I'm getting error messages. What I'm trying to do is get a decimal answer using abs() but it appears to only accept integer variables? How do I get the abs() to give me a a 3 decimal place answer.

don't supose you could explain that a little more, I got the feeling that fabs and abs do different things pther than double and floats?

Given the prototypes, I thought it was quite obvious. (You didn't follow the links and read the descriptions either, did you?)

  • abs is for int (not double)
  • fabs is for floating point (double or float)

Given the prototypes, I thought it was quite obvious. (You didn't follow the links and read the descriptions either, did you?)

  • abs is for int (not double)
  • fabs is for floating point (double or float)

i followed the links ..............never mind

This question has already been answered. Start a new discussion instead.