]> granicus.if.org Git - php/commitdiff
Another fix for issue indentified in bug #52550
authorIlia Alshanetsky <iliaa@php.net>
Fri, 6 Aug 2010 20:04:29 +0000 (20:04 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Fri, 6 Aug 2010 20:04:29 +0000 (20:04 +0000)
ext/standard/math.c

index 0691dc0402210208c65fb1f1887cd6caf85ba339..31848a3681710cf0ae6b13a4628f4f37d0cf37ba 100644 (file)
@@ -690,7 +690,11 @@ PHP_FUNCTION(log)
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "base must be greater than 0");                             
                RETURN_FALSE;
        }
-       RETURN_DOUBLE(log(num) / log(base));
+       if (base == 1) {
+                RETURN_DOUBLE(NAN);
+       } else {
+               RETURN_DOUBLE(log(num) / log(base));
+        }
 }
 /* }}} */