#include "basic_functions.h"
#include "php_string.h"
#include "php_rand.h"
+#include "php_math.h"
#include "zend_smart_str.h"
#ifdef HAVE_SPL
#include "ext/spl/spl_array.h"
php_error_docref(NULL, E_WARNING, "The supplied range exceeds the maximum array size: start=%0.0f end=%0.0f", end, start); \
RETURN_FALSE; \
} \
- size = (uint32_t)round(__calc_size); \
+ size = (uint32_t)_php_math_round(__calc_size, 0, PHP_ROUND_HALF_UP); \
array_init_size(return_value, size); \
zend_hash_real_init(Z_ARRVAL_P(return_value), 1); \
} while (0)
#ifndef PHP_MATH_H
#define PHP_MATH_H
+PHPAPI double _php_math_round(double, int, int);
PHPAPI zend_string *_php_math_number_format(double, int, char, char);
PHPAPI zend_string *_php_math_number_format_ex(double, int, char *, size_t, char *, size_t);
PHPAPI zend_string * _php_math_longtobase(zval *arg, int base);