Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:37764 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 71139 invoked from network); 21 May 2008 01:25:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 May 2008 01:25:09 -0000 Authentication-Results: pb1.pair.com smtp.mail=christopher.jones@oracle.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=christopher.jones@oracle.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain oracle.com from 148.87.113.118 cause and error) X-PHP-List-Original-Sender: christopher.jones@oracle.com X-Host-Fingerprint: 148.87.113.118 rgminet01.oracle.com Linux 2.4/2.6 Received: from [148.87.113.118] ([148.87.113.118:41394] helo=rgminet01.oracle.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B2/33-48013-3F973384 for ; Tue, 20 May 2008 21:25:08 -0400 Received: from agmgw2.us.oracle.com (agmgw2.us.oracle.com [152.68.180.213]) by rgminet01.oracle.com (Switch-3.2.4/Switch-3.1.6) with ESMTP id m4L1P25D011900; Tue, 20 May 2008 19:25:02 -0600 Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by agmgw2.us.oracle.com (Switch-3.2.0/Switch-3.2.0) with ESMTP id m4KHaxBW024020; Tue, 20 May 2008 19:25:01 -0600 Received: from dhcp-amer-rmdc-csvpn-gw5-141-144-104-235.vpn.oracle.com by acsmt354.oracle.com with ESMTP id 9758795571211333097; Tue, 20 May 2008 18:24:57 -0700 Message-ID: <483379DD.90307@oracle.com> Date: Tue, 20 May 2008 18:24:45 -0700 User-Agent: Thunderbird 2.0.0.14 (X11/20080505) MIME-Version: 1.0 To: Kalle Sommer Nielsen CC: Guilherme Blanco , PHP Developers Mailing List References: <4D0F5827906C42F69F16798598186754@KALLESAWESOMEPC> In-Reply-To: <4D0F5827906C42F69F16798598186754@KALLESAWESOMEPC> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE Subject: Re: [PHP-DEV] Add deg2grad() and grad2deg() in PHP5.3 From: christopher.jones@oracle.com (Christopher Jones) Even for small projects like this, we should get into the habit of creating an RFC on the Wiki. This is a way to explain the pros & cons so the functionality can be evaluated. You can argue about the algorithm choice and point out weakness (overflow/underflow?). It allows us to see where the code will be added, and lets us see some usecases (that will become tests) etc. Chris Kalle Sommer Nielsen wrote: > Ah Cheers > > I didn't think of number optimizations, but its done now > > Cheers > Kalle > > > ----- Original Message ----- From: "Guilherme Blanco" > > To: "Kalle Sommer Nielsen" > Cc: "PHP Developers Mailing List" > Sent: Tuesday, May 20, 2008 8:47 PM > Subject: Re: [PHP-DEV] Add deg2grad() and grad2deg() in PHP5.3 > > >> Hi... >> >> Are there any explanation why you used 360 and 400 and not optimized >> it? I know 1 full circle = 360 deg = 400 grads, but you can simplify >> it to: >> >> RETURN_DOUBLE((9 / 10) * deg); >> >> and... >> >> RETURN_DOUBLE((10 / 9) * grads); >> >> >> Regards, >> >> On Tue, May 20, 2008 at 3:22 PM, Kalle Sommer Nielsen >> wrote: >>> Greetings internals >>> >>> I've made two functions that allows convertion between degress and >>> gradians, >>> below is a pastebin >>> of the functions as that would look in math.c: >>> http://www.phpfi.com/318450 >>> >>> If no objections against it I will commit them in PHP_5_3 and HEAD and I >>> will prepare some test >>> cases for those aswell. >>> >>> >>> Cheers >>> Kalle >>> >>> -- >>> PHP Internals - PHP Runtime Development Mailing List >>> To unsubscribe, visit: http://www.php.net/unsub.php >>> >>> >> >> >> >> -- >> Guilherme Blanco - Web Developer >> CBC - Certified Bindows Consultant >> Cell Phone: +55 (16) 9166-6902 >> MSN: guilhermeblanco@hotmail.com >> URL: http://blog.bisna.com >> Rio de Janeiro - RJ/Brazil >> >> >> >> >> -- >> No virus found in this incoming message. >> Checked by AVG. >> Version: 7.5.524 / Virus Database: 269.23.21/1455 - Release Date: >> 19-05-2008 17:04 >> >> > > -- Christopher Jones, Oracle Email: christopher.jones@oracle.com Tel: +1 650 506 8630 Blog: http://blogs.oracle.com/opal/ Free PHP Book: http://tinyurl.com/f8jad