Thread
:
Perhaps I don't understand the function of fabs()
View Single Post
#
2
12-02-2008, 15:07
JimWright949
The Owen Day of Seattle
AKA: Jim Wright
FRC #4542 (Titanium Talons)
Team Role: Mentor
Join Date: Sep 2003
Rookie Year: 2003
Location: Redmond, WA
Posts: 94
Re: Perhaps I don't understand the function of fabs()
fabs is going to return a value of type float. You are asking printf to interpret this float as an int (%d). To fix it change the %d to %f:
printf("\r\n%f",fabs(-1));
JimWright949
View Public Profile
Visit JimWright949's homepage!
Find all posts by JimWright949
Find CD-Media Photos by JimWright949
Find CD-Media Papers by JimWright949