Hi,

Scott said he could apply the patch for you. And he is sitting right in front of me ..

regards,
Lukas

On 28.10.2008, at 18:28, Christian Seiler wrote:

Hi,

Sounds to me like you have done your homework and are committed to
maintaining this. Codewise I will leave the decision to Johannes however.

As Johannes has given his OK, I've created two patches (one for PHP 5.3
and one for HEAD):

http://www.christian-seiler.de/temp/php/2008-10-28-fpu/php-float-precision-5.3.patch
http://www.christian-seiler.de/temp/php/2008-10-28-fpu/php-float-precision-6.patch
(Both are basically identical)

I've tested them with the current PHP 5.3 branch under Linux and Windows
(gcc) and with current PHP 5.3 under Windows (MSVC8, i.e. 2005)

The patch does the following:

* New zend_float.h which defines the following macros:
      ZEND_FLOAT_DECLARE()   - Declare necessary helper vars
      ZEND_FLOAT_ENSURE()    - Ensure double precision
      ZEND_FLOAT_RESTORE()   - Restore previous precision
      ZEND_FLOAT_RETURN(val) - Return a double and restore prev. prec.
  (They are an alias to corresponding the XPFPA macros from my header
  file)

* Added my configure checks to acinclude.m4.

* Use them in zend_strtod.c and zend_operators.c in order to ensure
  that the precision used for calculations and string-to-float
  conversions is always double precision.

* Added Zend/tests/float_prec_001.phpt which makes sure that both
  calculations and string-to-float logic use double precision.
  [This will also detect misbehaving platforms.]

Please feel free to change any comments wrt. where this logic is from
and/or whitespace formatting in the files.

I'd appreciate it if you could commit this patch in the next days so I
can commit my patch for round() that relies on the above.

Regards,
Christian

Lukas Kahwe Smith
[EMAIL PROTECTED]




--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to