![]() |
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? |
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)); |
Re: Perhaps I don't understand the function of fabs()
Quote:
|
| All times are GMT -5. The time now is 00:58. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi