|
|
вернуться в форумОбщий форумHow to use "sqrt" function without including <math.h> I've got compilation error and I think it's because of including math.h. Can you advise me something? Re: How to use "sqrt" function without including <math.h> > I've got compilation error and I think it's because of including > math.h. Can you advise me something? I think your problem shouldn't be including <math.h> as I quest , it might be this int a; double b; .... b=sqrt(a); //compilation error here because the parameter pass to sqrt is int , and sqrt in library here has been overloaded for more than one argument type , but not for int. so the compiler don't know which one to pick it can be fix just by casting int a; double b; .... b=sqrt((double)a); // can be compiled now If you want to view error in more detail than online status page, submit your solution via e-mail (read FAQ if you don't know how) anyway if you really can't include <math.h> , implement you own sqrt (one method is using numerical method) |
|
|