From owner-freebsd-hackers@FreeBSD.ORG Tue Sep 28 18:22:00 2010 Return-Path: Delivered-To: hackers@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0609106564A for ; Tue, 28 Sep 2010 18:22:00 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id 4A9898FC12 for ; Tue, 28 Sep 2010 18:21:59 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.3/8.14.2) with ESMTP id o8SI1c1v076674; Tue, 28 Sep 2010 14:01:38 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.3/8.14.2/Submit) id o8SI1c00076673; Tue, 28 Sep 2010 14:01:38 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Date: Tue, 28 Sep 2010 14:01:38 -0400 From: David Schultz To: =?iso-8859-1?Q?P=C1LI_G=E1bor_J=E1nos?= Message-ID: <20100928180138.GA76574@zim.MIT.EDU> Mail-Followup-To: =?iso-8859-1?Q?P=C1LI_G=E1bor_J=E1nos?= , hackers@freebsd.org References: <4CA0FF2C.9010108@elte.hu> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4CA0FF2C.9010108@elte.hu> Cc: hackers@FreeBSD.ORG Subject: Re: clogf(3) (complex.h) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Sep 2010 18:22:00 -0000 On Mon, Sep 27, 2010, PÁLI Gábor János wrote: > Hello, > > I would like to use the clogf(3) function from complex.h, but it seems > there is no such function implemented on FreeBSD (8.1-STABLE). Am I > missing something or is there any way to work this around? A simple workaround is something like: logf(cabs(z)) + i * cargf(z) There are a few special cases, e.g., when creal(z) < 0, you have to add i * copysign(M_PI, cimag(z)), and when creal(z) == 0, it's M_PI/2...