php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51478 Unexpected result for tan(M_PI_2)
Submitted: 2010-04-05 14:49 UTC Modified: 2010-04-05 16:05 UTC
From: rik dot veenboer at gmail dot com Assigned:
Status: Not a bug Package: Math related
PHP Version: 5.3.2 OS: Windows 7
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: rik dot veenboer at gmail dot com
New email:
PHP Version: OS:

 

 [2010-04-05 14:49 UTC] rik dot veenboer at gmail dot com
Description:
------------
When running the code, the return value is a float: 1.6331239353195E+16, while a value of 1 is expected. This was posted before as bug #31236, but not fixed since 2004.

Test script:
---------------
tan(M_PI_2)

Expected result:
----------------
1

Actual result:
--------------
1.6331239353195E+16

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-04-05 15:46 UTC] pajoye@php.net
-Status: Open +Status: Bogus
 [2010-04-05 15:46 UTC] pajoye@php.net
Please read again the tangent properties (and PI).
 [2010-04-05 16:05 UTC] rik dot veenboer at gmail dot com
I confused the sin() and the tan() functions. Now is see that tan(M_PI_2) should go to infinity. This bug can be removed.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun May 11 20:01:28 2025 UTC