}
/* }}} */
-/* {{{ php_asinh
-*/
-static double php_asinh(double z)
-{
-#ifdef HAVE_ASINH
- return(asinh(z));
-#else
-# ifdef _WIN64
- if (z >= 0) {
- return log(z + sqrt(z * z + 1));
- }
- else {
- return -log(-z + sqrt(z * z + 1));
- }
-# else
- return(log(z + sqrt(1 + pow(z, 2))) / log(M_E));
-# endif
-#endif
-}
-/* }}} */
-
-/* {{{ php_acosh
-*/
-static double php_acosh(double x)
-{
-#ifdef HAVE_ACOSH
- return(acosh(x));
-#else
-# ifdef _WIN64
- if (x >= 1) {
- return log(x + sqrt(x * x - 1));
- } else {
- return ZEND_NAN;
- }
-# else
- return(log(x + sqrt(x * x - 1)));
-# endif
-#endif
-}
-/* }}} */
-
-/* {{{ php_atanh
-*/
-static double php_atanh(double z)
-{
-#ifdef HAVE_ATANH
- return(atanh(z));
-#else
- return(0.5 * log((1 + z) / (1 - z)));
-#endif
-}
-/* }}} */
-
-/* {{{ php_log1p
-*/
-static double php_log1p(double x)
-{
-#ifdef HAVE_LOG1P
- return(log1p(x));
-#else
- return(log(1 + x));
-#endif
-}
-/* }}} */
-
-/* {{{ php_expm1
-*/
-static double php_expm1(double x)
-{
-#ifndef PHP_WIN32
- return(expm1(x));
-#else
- return(exp(x) - 1);
-#endif
-}
-/* }}}*/
-
/* {{{ proto int|float abs(int|float number)
Return the absolute value of the number */
PHP_FUNCTION(abs)
ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_DOUBLE(num)
ZEND_PARSE_PARAMETERS_END();
- RETURN_DOUBLE(php_asinh(num));
+ RETURN_DOUBLE(asinh(num));
}
/* }}} */
ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_DOUBLE(num)
ZEND_PARSE_PARAMETERS_END();
- RETURN_DOUBLE(php_acosh(num));
+ RETURN_DOUBLE(acosh(num));
}
/* }}} */
ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_DOUBLE(num)
ZEND_PARSE_PARAMETERS_END();
- RETURN_DOUBLE(php_atanh(num));
+ RETURN_DOUBLE(atanh(num));
}
/* }}} */
/* }}} */
/* {{{ proto float expm1(float number)
- Returns exp(number) - 1, computed in a way that accurate even when the value of number is close to zero */
-/*
- WARNING: this function is experimental: it could change its name or
- disappear in the next version of PHP!
+ Returns exp(number) - 1, computed in a way that accurate even when the value of number is close to zero
*/
PHP_FUNCTION(expm1)
{
Z_PARAM_DOUBLE(num)
ZEND_PARSE_PARAMETERS_END();
- RETURN_DOUBLE(php_expm1(num));
+ RETURN_DOUBLE(expm1(num));
}
/* }}} */
/* {{{ proto float log1p(float number)
- Returns log(1 + number), computed in a way that accurate even when the value of number is close to zero */
-/*
- WARNING: this function is experimental: it could change its name or
- disappear in the next version of PHP!
+ Returns log(1 + number), computed in a way that accurate even when the value of number is close to zero
*/
PHP_FUNCTION(log1p)
{
Z_PARAM_DOUBLE(num)
ZEND_PARSE_PARAMETERS_END();
- RETURN_DOUBLE(php_log1p(num));
+ RETURN_DOUBLE(log1p(num));
}
/* }}} */
RETURN_DOUBLE(log(num));
}
-#ifdef HAVE_LOG2
if (base == 2.0) {
RETURN_DOUBLE(log2(num));
}
-#endif
if (base == 10.0) {
RETURN_DOUBLE(log10(num));
Z_PARAM_DOUBLE(num2)
ZEND_PARSE_PARAMETERS_END();
-#if HAVE_HYPOT
RETURN_DOUBLE(hypot(num1, num2));
-#elif defined(_MSC_VER)
- RETURN_DOUBLE(_hypot(num1, num2));
-#else
- RETURN_DOUBLE(sqrt((num1 * num1) + (num2 * num2)));
-#endif
}
/* }}} */