Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:37765 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 75884 invoked from network); 21 May 2008 02:08:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 May 2008 02:08:19 -0000 Authentication-Results: pb1.pair.com smtp.mail=kalle@zesix.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=kalle@zesix.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain zesix.com from 67.19.4.138 cause and error) X-PHP-List-Original-Sender: kalle@zesix.com X-Host-Fingerprint: 67.19.4.138 8a.4.1343.static.theplanet.com Received: from [67.19.4.138] ([67.19.4.138:51825] helo=web.clantemplates.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F0/30-07862-11483384 for ; Tue, 20 May 2008 22:08:17 -0400 Received: from [81.216.205.138] (helo=KALLESAWESOMEPC) by web.clantemplates.com with esmtpa (Exim 4.63) (envelope-from ) id 1JydkP-000829-4M; Tue, 20 May 2008 19:07:46 -0700 Message-ID: To: "Christopher Jones" Cc: "Guilherme Blanco" , "PHP Developers Mailing List" References: <4D0F5827906C42F69F16798598186754@KALLESAWESOMEPC> <483379DD.90307@oracle.com> In-Reply-To: <483379DD.90307@oracle.com> Date: Wed, 21 May 2008 04:08:08 +0200 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="UTF-8"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Windows Mail 6.0.6001.18000 X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6001.18000 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - web.clantemplates.com X-AntiAbuse: Original Domain - lists.php.net X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - zesix.com Subject: Re: [PHP-DEV] Add deg2grad() and grad2deg() in PHP5.3 From: kalle@zesix.com ("Kalle Sommer Nielsen") Hi Chris I didn't think of making an RFC for this mainly because its so small and one of the only use cases I could see would be the same as I see for rad2deg() and deg2rad(). And yes theres probably overflow and underflow just like in a couple of the other math functions. In my small perfect world I would do a check and add a warning or notice for incorrect values but Im sure that most around here wouldn't agree with that part ;) Kalle ----- Original Message ----- From: "Christopher Jones" To: "Kalle Sommer Nielsen" Cc: "Guilherme Blanco" ; "PHP Developers Mailing List" Sent: Wednesday, May 21, 2008 3:24 AM Subject: Re: [PHP-DEV] Add deg2grad() and grad2deg() in PHP5.3 > > 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 > > > > > -- > 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 > >