Re: Build-in sqrt()?
- From: Tim Prince <timothyprince@xxxxxxxxxxxxx>
- Date: Mon, 27 Nov 2006 05:14:39 GMT
peng.xiaoyu@xxxxxxxxx wrote:
why this c code can be compiled and linked without -lm?
#include<math.h>
#include<stdio.h>
int main()
{
printf("%f\n",sqrt(2.0));
return 0;
}
even NO sqrt symbol when i use nm to list symbols from the object file
someone can give me a hint? i'm using a gcc-4.1.2 with glibc2.4.1 under
linux
First read your handy docs, e.g.
% info gcc
then ask specific further questions on
gcc-help@xxxxxxxxxxx
If you are interested, check your generated code to see whether sqrt() was evaluated at compile time, or at run time using a built-in CPU instruction.
.
- References:
- Build-in sqrt()?
- From: peng.xiaoyu@xxxxxxxxx
- Build-in sqrt()?
- Prev by Date: Re: Writing an int to a file, not quite sure how buffers work.
- Next by Date: Re: Build-in sqrt()?
- Previous by thread: Re: Build-in sqrt()?
- Next by thread: Re: Build-in sqrt()?
- Index(es):