[lug] math.h Weirdness

George Sexton gsexton at mhsoftware.com
Mon Mar 12 20:48:39 MDT 2007


find /usr/include -type f -name "*.h" -exec grep -Hie sqrt "{}" \;



Bill Thoen wrote:
> Am I mistaken in thinking that in C the sqrt() function is prototyped in
> math.h? I just tried to build a simple C program that called sqrt() and the
> linker balked. I then tried:
>
> $ grep sqrt /usr/include/math.h
> define M_2_SQRTPI     1.12837916709551257390  /* 2/sqrt(pi) */
> define M_SQRT2        1.41421356237309504880  /* sqrt(2) */
> define M_SQRT1_2      0.70710678118654752440  /* 1/sqrt(2) */
> define M_2_SQRTPIl    1.1283791670955125738961589031215452L  /* 2/sqrt(pi) */
> define M_SQRT2l       1.4142135623730950488016887242096981L  /* sqrt(2) */
> define M_SQRT1_2l     0.7071067811865475244008443621048490L  /* 1/sqrt(2) */
>
> It's not there! Shouldn't it be? If not, where is it these days, or has the
> square root been retired?
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> Join us on IRC: lug.boulder.co.us port=6667 channel=#colug
>
>   

-- 
George Sexton
MH Software, Inc.
Voice: +1 303 438 9585
URL:   http://www.mhsoftware.com/




More information about the LUG mailing list