diff options
author | Christian Seiler <cseiler@php.net> | 2008-12-02 16:27:15 +0000 |
---|---|---|
committer | Christian Seiler <cseiler@php.net> | 2008-12-02 16:27:15 +0000 |
commit | 2e32354456357d1d9adffb6dbdd49c281c5ccd58 (patch) | |
tree | 78305872c715b1c970b707b30b92d9129005ac14 /ext/standard/php_math.h | |
parent | 04c528609a1849d19bed744f9f2bfcc0b7eab0ae (diff) | |
download | php-git-2e32354456357d1d9adffb6dbdd49c281c5ccd58.tar.gz |
- MFH: 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 b3fd245e75..d18bc6e1f9 100644 --- a/ext/standard/php_math.h +++ b/ext/standard/php_math.h @@ -152,4 +152,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 */ |