[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

sqrt C function

when i try to use the sqrt function in gcc 3.0, and the gcc that's standard 
with 2.2r3 ( i forget the version)  i get errors. here's some example code:

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

double num;
double num_root;

int main ()
    num = 4;
    num_root = sqrt(num);
    return (0);

fails to compile. i've tried using double as well as float variables. i'm 
sure this is due to poor coding, but i'm looked at the man page and 
linuxdoc.org and cannot find any example implementations of sqrt(). I'm 
running i386 arch, and have math.h (as well as the complete gcc 3.0) 

thanks for your help!

Reply to: