diff options
author | Christian Seiler <cseiler@php.net> | 2008-12-02 16:25:06 +0000 |
---|---|---|
committer | Christian Seiler <cseiler@php.net> | 2008-12-02 16:25:06 +0000 |
commit | 2836cce10bb65f5468273e46f9dc4ac248234427 (patch) | |
tree | f293ee910a2be44f139d4dfc7121bf069bb9da72 /ext/standard/php_math.h | |
parent | 694771f14c183f62a752f1ee0e41dc12b48cbebb (diff) | |
download | php-git-2836cce10bb65f5468273e46f9dc4ac248234427.tar.gz |
- Implemented http://wiki.php.net/rfc/rounding
Diffstat (limited to 'ext/standard/php_math.h')
-rw-r--r-- | ext/standard/php_math.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/ext/standard/php_math.h b/ext/standard/php_math.h index 2f26e1d681..32214ae83b 100644 --- a/ext/standard/php_math.h +++ b/ext/standard/php_math.h @@ -149,4 +149,21 @@ PHP_FUNCTION(atanh); #define M_SQRT3 1.73205080756887729352 /* sqrt(3) */ #endif +/* Define rounding modes (all are round-to-nearest) */ +#ifndef PHP_ROUND_HALF_UP +#define PHP_ROUND_HALF_UP 0x01 /* Arithmetic rounding, up == away from zero */ +#endif + +#ifndef PHP_ROUND_HALF_DOWN +#define PHP_ROUND_HALF_DOWN 0x02 /* Down == towards zero */ +#endif + +#ifndef PHP_ROUND_HALF_EVEN +#define PHP_ROUND_HALF_EVEN 0x03 /* Banker's rounding */ +#endif + +#ifndef PHP_ROUND_HALF_ODD +#define PHP_ROUND_HALF_ODD 0x04 +#endif + #endif /* PHP_MATH_H */ |