Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Nov 2010 17:25:39 +0100
From:      =?ISO-8859-15?Q?Michael_Gr=FCnewald?= <michael.grunewald@laposte.net>
To:        Anonymous <swell.k@gmail.com>
Cc:        Alexander Best <arundel@freebsd.org>, freebsd-questions@freebsd.org
Subject:   Re: libm alternative in ports
Message-ID:  <4CEE8E03.8010805@laposte.net>
In-Reply-To: <86ipzlg7vt.fsf@gmail.com>
References:  <20101123210013.GA71784@freebsd.org> <86ipzlg7vt.fsf@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Hello all,

Anonymous wrote:
> Alexander Best<arundel@freebsd.org>  writes:
>> does anybody if there's an alternative for libm in the ports dir? i need it,
>> because the newest snapshots of mplayer require log2() and log2f(), which the
>> base libm doesn't support.
>
> for mplayer I'd suggest using code from x264 because both projects use GPLv2+
>
>    #if !HAVE_LOG2F
>    #define log2f(x) (logf(x)/0.693147180559945f)
>    #define log2(x) (log(x)/0.693147180559945)
>    #endif

In `math.h', there is the following definition:

--8<---
#define M_LN2           0.69314718055994530942  /* log e2 */
--8<---

of which you can take advantage for your definition of log2f and log2. 
Note that this macro is not described in math(3).
-- 
Regards,
Michael



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4CEE8E03.8010805>