Blog Archives

Just a reminder about the abs function

Turns out the source of my problem had to do with the abs function. Remember that abs(double) will truncate the double and return an integer:

double pi = abs(-3.14159);
// returns 3
Advertisements