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
 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 01:01:30 2024 UTC