Browse Source

Another fix for issue indentified in bug #52550

experimental/with_scalar_types
Ilia Alshanetsky 16 years ago
parent
commit
34e8b615ed
  1. 6
      ext/standard/math.c

6
ext/standard/math.c

@ -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));
}
}
/* }}} */

Loading…
Cancel
Save