Re: Add deg2grad() and grad2deg() in PHP5.3
| From: | Guilherme Blanco | Date: | Tue, 20 May 2008 18:47:25 +0000 |
| Subject: | Re: Add deg2grad() and grad2deg() in PHP5.3 | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-37753@lists.php.net to get a copy of this message | ||
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 <kalle@zesix.com> 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