Trigonometry missing?

I have been testing some c-files in Fedora 6 and 15 and it looks as if the math.h is different in Linux compared to Windows (BCC 4 and VC5). Where are all trigonometrics like sin and cos?

What do you mean by "different"? Can you give a short example program? Can you tell what you're expecting and what you're getting?

Not sure of what you mean, but most of the questions related to the use of the GNU Libc mathematical funcions have to do with linking time problems. To compile and link programs that use the functions from the mathematical library, you need to explicitly tell gcc (or g++) to link your program agaist the library:

gcc -o mathdemo mathdemo.c -lm

OK this is a simple code:

#include<stdio.h>
#include<math.h>

void main ()
{
int a;
float b,c,d,e;

a=628;
b=a/600;
c=sin(b);
d=cos(b);
e=tan(b);

printf("\n%d",a);
printf("\n%f",b);
printf("\n%f",c);
printf("\n%f",d);
printf("\n%f",e);

}

Test this in Linux, please!

---------- Post updated at 04:02 AM ---------- Previous update was at 03:54 AM ----------

OK I will see if I have any mathematic lib in my Fedora. Could the reason be that math.h in Linux should work for all kind of CPU (not only x86) so you need a sep lib for every CPU.

Tested, and it works as I would expect. But as long as you don't tell us what exact problems you encounter, I doubt that will tell you much, or that we be able to help you.

Yeap. The program compile, link and does what it is supposed to do.

I get this with Fedora 15:

$ gcc -o trig trig.c
/tmp/cc5d4TTg.o: In function `main':
trig.c:(.text+0x40): undefined reference to `sin'
trig.c:(.text+0x50): undefined reference to `cos'
trig.c:(.text+0x60): undefined reference to `tan'

So I guess this version of math.h is not complete....

On the contrary, your math.h is complete (there's a standard, after all, what has to be provided). If you use a function that's not defined, you'd get a warning about an "implicit declaration". But as pflynn said above: you have to explicitly link the math library, using the -lm switch.

OK now it works...I must link libm with -lm
gcc trig.c -lm -o trig

Is this kind of trig faster than using a table?
I have seen that some routines for FFT are using a table with sin/cos data.

So, I was right:

gcc -o trig trig.c -lm

A table would have fantastic speed but very poor accuracy; the lilbrary routines are built for maximum accuracy on the assumption they may be put to scientific or mathematical use.

If you'd posted what your error message was in the first place we could have solved your problem in one post instead of two pages.