From owner-freebsd-questions@FreeBSD.ORG Fri Nov 5 18:21:42 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 79499106566C for ; Fri, 5 Nov 2010 18:21:42 +0000 (UTC) (envelope-from aimass@yabarana.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 1647F8FC16 for ; Fri, 5 Nov 2010 18:21:41 +0000 (UTC) Received: by wyb34 with SMTP id 34so1377266wyb.13 for ; Fri, 05 Nov 2010 11:21:41 -0700 (PDT) MIME-Version: 1.0 Received: by 10.227.142.145 with SMTP id q17mr2373669wbu.229.1288981300666; Fri, 05 Nov 2010 11:21:40 -0700 (PDT) Sender: aimass@yabarana.com Received: by 10.227.145.133 with HTTP; Fri, 5 Nov 2010 11:21:40 -0700 (PDT) In-Reply-To: <20101105191359.2c047c29.freebsd@edvax.de> References: <20101105191359.2c047c29.freebsd@edvax.de> Date: Fri, 5 Nov 2010 14:21:40 -0400 X-Google-Sender-Auth: GqTQq301uLPVAHIng3bE3A63iFM Message-ID: From: Alejandro Imass To: Polytropon Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: FreeBSD Mailing list Subject: Re: how to generate pi in c 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: Fri, 05 Nov 2010 18:21:42 -0000 On Fri, Nov 5, 2010 at 2:13 PM, Polytropon wrote: > On Fri, 5 Nov 2010 13:39:05 -0400, Alejandro Imass wrote: >> This is how I do it in perl >> use constant PI =3D> 4 * atan2(1, 1); >> >> In C it owuld probably be (using math.h): >> >> pi =3D 4.0*atan(1.0); > > Or use M_PI from /usr/include/math.h, as we already #include'd > it. :-) > > #define M_PI =A0 =A0 =A0 =A0 =A0 =A03.14159265358979323846 > jaja. live and learn > > > -- > Polytropon > Magdeburg, Germany > Happy FreeBSD user since 4.0 > Andra moi ennepe, Mousa, ... >