From owner-freebsd-questions@FreeBSD.ORG Thu Nov 25 16:25:43 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B5EE106564A for ; Thu, 25 Nov 2010 16:25:43 +0000 (UTC) (envelope-from michael.grunewald@laposte.net) Received: from cc-smtpout3.netcologne.de (cc-smtpout3.netcologne.de [89.1.8.213]) by mx1.freebsd.org (Postfix) with ESMTP id 3CCDA8FC13 for ; Thu, 25 Nov 2010 16:25:42 +0000 (UTC) Received: from cc-smtpin1.netcologne.de (cc-smtpin1.netcologne.de [89.1.8.201]) by cc-smtpout3.netcologne.de (Postfix) with ESMTP id 7E30712E1D; Thu, 25 Nov 2010 17:25:41 +0100 (CET) Received: from llea.celt.neu (xdsl-89-0-141-236.netcologne.de [89.0.141.236]) by cc-smtpin1.netcologne.de (Postfix) with ESMTP id 47DFD11E77; Thu, 25 Nov 2010 17:25:39 +0100 (CET) Message-ID: <4CEE8E03.8010805@laposte.net> Date: Thu, 25 Nov 2010 17:25:39 +0100 From: =?ISO-8859-15?Q?Michael_Gr=FCnewald?= User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.15) Gecko/20101122 SeaMonkey/2.0.10 MIME-Version: 1.0 To: Anonymous References: <20101123210013.GA71784@freebsd.org> <86ipzlg7vt.fsf@gmail.com> In-Reply-To: <86ipzlg7vt.fsf@gmail.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Cc: Alexander Best , freebsd-questions@freebsd.org Subject: Re: libm alternative in ports X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Nov 2010 16:25:43 -0000 Hello all, Anonymous wrote: > Alexander Best 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