C (math.h)not doing right math? exp() issue.
Hi,
Look at the following please. Code:
#include<stdio.h> Code:
[champ@alligator dsp]$ ./signal Code:
octave:12> exp(61) Any ideas? Thanks |
Quote:
Sure - compile with -Wall and make sure you have no warnings - you should have warnings until you fix your 'printf' statement. And, to be more precise - never compile without -Wall, better yet compile also with -Wextra. |
I tried
Code:
Code:
Code:
octave:14> sin(60) |
Though I do agree with Sergei, I might have pointed out the specific error in the arguments and format specifier for printf.
Try this: Code:
#include <stdio.h> Code:
gcc -Wall -lm -o exptest exptest.c Code:
./exptest |
Awesome!!!!
Thank you so much!1 |
Quote:
From my very long career I know that achieving the state when developers around finally accept that they can make and do make mistakes, and that's why compilers and other tools that report developers' mistakes (especially the subtle ones) should be used is often much more difficult than solving technical problems. So, my goal was to show the OP that compiler is smart and that the smartness should be utilized. I always say that if compiler issues a warning, either the compiler or I am not right, but typically it's me who isn't right. On the same note - however much I love Perl, I hate even more Perl users who don't use Code:
use strict; |
thanks.
Thanks.
Please Tell me how can i use this function using scanf function. |
Quote:
|
All times are GMT -5. The time now is 06:58 PM. |