Re: [PHP] COS function

2002-02-01 Thread LaserJetter
Maybe this is something which should be changed in future PHP releases. Even the Windows Calcuator and my old scientific calc know that cos 90ยบ is 0!! Out of interest, have you tried any results using trignonometrical identities ie tan() = sin() / cos() to see if the error cancels out in the end?

Re: [PHP] COS function

2002-01-31 Thread Bas Jobsen
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