Re: [PHP-DEV] fmod() function
Would it be worth extending the engine to apply the fmod() behavior to the % operator when operating on doubles? I don't think so, it would be quite a weird BC bug. I don't remember any complaints about its current behavior in the past few years so I don't think it's worth changing. FYI I'm porting some C/Python classes which are used for astronomical calculations (amateur astronomers may know of Meeus). I considered just rolling my own fmod() function in PHP but one look at the function in the glibc source scared the bejesus out of me :) On the other hand, eventually getting a goodly chunk of the match functions from glibc into PHP must be a 'good thing' I guess. Cheers, Graeme -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] fmod() function
I was porting some Python scripts to PHP and came across the fmod() function. Since it's not implemented in PHP so I whipped up an fmod function for inclusion into ext/standard/math.c which I've pasted below. I can create a diff if necessary to include the 2 small changes to basic_functions.c and php_math.h Cheers, Graeme /* {{{ proto double fmod(double x, double y) Returns the remainder of dividing x by y as a double */ PHP_FUNCTION(fmod) { zval **num1, **num2; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, num1, num2) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_double_ex(num1); convert_to_double_ex(num2); Z_DVAL_P(return_value) = fmod(Z_DVAL_PP(num1), Z_DVAL_PP(num2)); Z_TYPE_P(return_value) = IS_DOUBLE; } /* }}} */ -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Win32 PHP builds for Ming-0.1.1
Is there anyone on the list doing PHP-Win32 builds that can create a dll (or complete Win32 build) that has support for either ming-0.1.1 or possibly the new 0.2-pre? The current PHP builds only have the 0.1 lib and I'm in a funny position of needing 0.1.1. I've had a crack and compiling it myself but haven't got very far. Cheers, Graeme -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]