Dec 2, 2003 #1 amarg Programmer Nov 19, 2002 106 IN Hi all, I want to use the function log2(). In my system this function is in sunmath.h. But i don't think this file is in every system. Is there any standard file for ANSI-C where i can find the log2(). Regards, Amar
Hi all, I want to use the function log2(). In my system this function is in sunmath.h. But i don't think this file is in every system. Is there any standard file for ANSI-C where i can find the log2(). Regards, Amar
Dec 2, 2003 #2 Salem Programmer Apr 29, 2003 2,455 GB Just use the identity Code: loga(b) = logx(b) / logx(a); So long as you have the log function in one base, you can calculate logs in any other base. -- Upvote 0 Downvote
Just use the identity Code: loga(b) = logx(b) / logx(a); So long as you have the log function in one base, you can calculate logs in any other base. --
Dec 2, 2003 Thread starter #3 amarg Programmer Nov 19, 2002 106 IN Thanks for your reply. I was using that formula. I just want to know log2() function exist in math.h or not. In Linux log2() is in math.h but on the sun machine it is not in math.h. Regards, Upvote 0 Downvote
Thanks for your reply. I was using that formula. I just want to know log2() function exist in math.h or not. In Linux log2() is in math.h but on the sun machine it is not in math.h. Regards,
Dec 2, 2003 #4 Salem Programmer Apr 29, 2003 2,455 GB log2 isn't a standard function, so it's availability will vary -- Upvote 0 Downvote