diff options
author | Jakub Zelenka <bukka@php.net> | 2016-06-26 14:03:01 +0100 |
---|---|---|
committer | Jakub Zelenka <bukka@php.net> | 2016-06-26 14:03:01 +0100 |
commit | 3f13507dd281adf0518c9162dce5391e9250e93b (patch) | |
tree | 70f4addc37de995e1a58e5baec180e0ef266a937 /main/php.h | |
parent | 158b537c99ca5fc7846e7d16d532644be95894a7 (diff) | |
download | php-git-3f13507dd281adf0518c9162dce5391e9250e93b.tar.gz |
Use one place to define max length of double
Introduce new constant PHP_DOUBLE_MAX_LENGTH for that purpose
Diffstat (limited to 'main/php.h')
-rw-r--r-- | main/php.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/main/php.h b/main/php.h index 8eb1c53e8b..8cc7851016 100644 --- a/main/php.h +++ b/main/php.h @@ -231,6 +231,14 @@ char *strerror(int); #define INT_MIN (- INT_MAX - 1) #endif +/* double limits */ +#include <float.h> +#if defined(DBL_MANT_DIG) && defined(DBL_MIN_EXP) +#define PHP_DOUBLE_MAX_LENGTH (3 + DBL_MANT_DIG - DBL_MIN_EXP) +#else +#define PHP_DOUBLE_MAX_LENGTH 1080 +#endif + #define PHP_GCC_VERSION ZEND_GCC_VERSION #define PHP_ATTRIBUTE_MALLOC ZEND_ATTRIBUTE_MALLOC #define PHP_ATTRIBUTE_FORMAT ZEND_ATTRIBUTE_FORMAT |