Re: [PHP-DEV] Add deg2grad() and grad2deg() in PHP5.3

2008-05-21 Thread Antony Dovgal
On 20.05.2008 22:22, 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 Functions that can be implemented in one line of PH

Re: [PHP-DEV] Add deg2grad() and grad2deg() in PHP5.3

2008-05-20 Thread Rasmus Lerdorf
lopers 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

Re: [PHP-DEV] Add deg2grad() and grad2deg() in PHP5.3

2008-05-20 Thread Kalle Sommer Nielsen
EMAIL PROTECTED]> Cc: "Guilherme Blanco" <[EMAIL PROTECTED]>; "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 cr

Re: [PHP-DEV] Add deg2grad() and grad2deg() in PHP5.3

2008-05-20 Thread Christopher Jones
lherme Blanco" > <[EMAIL PROTECTED]> > To: "Kalle Sommer Nielsen" <[EMAIL PROTECTED]> > 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... >

Re: [PHP-DEV] Add deg2grad() and grad2deg() in PHP5.3

2008-05-20 Thread Kalle Sommer Nielsen
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_DOUBL

Re: [PHP-DEV] Add deg2grad() and grad2deg() in PHP5.3

2008-05-20 Thread Guilherme Blanco
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 <[EMAIL

[PHP-DEV] Add deg2grad() and grad2deg() in PHP5.3

2008-05-20 Thread Kalle Sommer Nielsen
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 case