Nmap Development mailing list archives
Re: [PATCH] Change pow(, 0.5) -> sqrt() in osscan[2].cc
From: Kris Katterjohn <kjak () ispwest com>
Date: Sat, 02 Sep 2006 22:28:31 -0500
Fyodor wrote:
On Sat, Sep 02, 2006 at 10:17:16PM -0500, Kris Katterjohn wrote:The attached patch just uses sqrt() instead of pow(,0.5) on everything instead of just Linux in osscan.cc and osscan2.cc. Apparently (judging by the comment in osscan.cc), sqrt() is used on Linux because pow() is broken in some libc versions. sqrt(X) is the same as pow(X,0.5), so we can just use sqrt() and avoid the #ifdef.Are you sure that sqrt() is portable to all the systems supported by Nmap, including Windows? Cheers, -F _______________________________________________ Sent through the nmap-dev mailing list http://cgi.insecure.org/mailman/listinfo/nmap-dev Archived at http://SecLists.Org
I was going to assume it was because it's in ANSI C, but I went ahead and looked. I saw this and thought it meant it's portable to Windows: http://msdn2.microsoft.com/en-us/library/f1xa99e6.aspx Thanks, Kris Katterjohn _______________________________________________ Sent through the nmap-dev mailing list http://cgi.insecure.org/mailman/listinfo/nmap-dev Archived at http://SecLists.Org
Current thread:
- [PATCH] Change pow(, 0.5) -> sqrt() in osscan[2].cc Kris Katterjohn (Sep 02)
- Re: [PATCH] Change pow(, 0.5) -> sqrt() in osscan[2].cc Fyodor (Sep 02)
- Re: [PATCH] Change pow(, 0.5) -> sqrt() in osscan[2].cc Kris Katterjohn (Sep 02)
- Re: [PATCH] Change pow(, 0.5) -> sqrt() in osscan[2].cc Fyodor (Sep 02)
- Re: [PATCH] Change pow(, 0.5) -> sqrt() in osscan[2].cc Kris Katterjohn (Sep 02)
- Re: [PATCH] Change pow(, 0.5) -> sqrt() in osscan[2].cc Andreas Ericsson (Sep 04)
- Re: [PATCH] Change pow(, 0.5) -> sqrt() in osscan[2].cc Kris Katterjohn (Sep 02)
- Re: [PATCH] Change pow(, 0.5) -> sqrt() in osscan[2].cc Fyodor (Sep 02)