|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Perhaps I don't understand the function of fabs()
when I do a
printf("\r\n%d",fabs(-1)); I get some huge number that appears to signal a misdeclaration or something. Why won't this work? |
|
#2
|
||||
|
||||
|
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)); |
|
#3
|
||||||
|
||||||
|
Re: Perhaps I don't understand the function of fabs()
Quote:
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Still don't understand how to wire IR? | popnbrown | Programming | 1 | 28-01-2008 22:45 |
| Pinning? Apparently I just don't seem to understand | Brindza | Rules/Strategy | 61 | 14-03-2006 21:30 |
| Don't Do What Seanny Don't Does | Mike Iantorno | General Forum | 38 | 05-02-2003 23:56 |
| Basketball? perhaps...read on | rmadsen55 | Rumor Mill | 3 | 02-01-2003 21:37 |
| Perhaps my biggest disappointment | archiver | 2001 | 2 | 23-06-2002 22:23 |