Cause there is no exact representation of PI, you get a floatingpoint 
representation of nearly zero.

Try:
echo intval(cos(0.5*pi()));
echo printf("%.1f",cos(0.5*pi()));

Op donderdag 31 januari 2002 13:39, schreef michael Rabbitte:
> I was wondering about the cos fuction in PHP when I try to get cos of 90
> degrees I'm not getting 0 but some weird no. (i.e 6.28...E-17) is there
> anything I can do to get zero as my answer. P.S. I have converted my
> degrees to radians!
> Mike.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to