php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #70568
Patch php-5.6.13-atan2.diff revision 2015-09-30 22:13 UTC by n13 at inbox dot ru

Patch php-5.6.13-atan2.diff for Math related Bug #70568

Patch version 2015-09-30 22:13 UTC

Return to Bug #70568 | Download this patch
Patch Revisions:

Developer: n13@inbox.ru

--- php-5.6.13-src/ext/standard/math.c	2015-09-02 17:02:46.000000000 +0700
+++ php-5.6.13-src.new/ext/standard/math.c	2015-10-01 02:09:24.520633849 +0700
@@ -465,7 +465,15 @@
 	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &num1, &num2) == FAILURE) {
 		return;
 	}
+#if defined(WINDOWS)
+	if (isinf(num1) && isinf(num2))
+		RETURN_DOUBLE(atan2(copysign(1, num1), copysign(1, num2)));
+	} else {
+		RETURN_DOUBLE(atan2(num1, num2));
+	}
+#else
 	RETURN_DOUBLE(atan2(num1, num2));
+#endif
 }
 /* }}} */
 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 05:01:30 2024 UTC