#14630 [Fbk->NoF]: integers wrapping around rather than being promoted into floats on overflow

From: Date: Thu, 08 Aug 2002 05:00:13 +0000
Subject: #14630 [Fbk->NoF]: integers wrapping around rather than being promoted into floats on overflow
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-16225@lists.php.net to get a copy of this message
ID: 14630 Updated by: php-bugs@lists.php.net Reported By: markmont@umich.edu -Status: Feedback +Status: No Feedback Bug Type: Math related Operating System: Solaris 8, 64-bit PHP Version: 4.1.0 New Comment: No feedback was provided for this bug for over a month, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open". Previous Comments: ------------------------------------------------------------------------ [2002-07-07 13:31:19] derick@php.net This works fine for me on Linux with the latest development CVS version of PHP (On Linux) provided that you use printf ("LONG_MIN -1 = %f", LONG_MIN - 1); instead, because the value of LONG_MIN - 1 does not fit in a field with %ld. Can you try this with the latest CVS version, and report back? Derick ------------------------------------------------------------------------ [2001-12-20 13:45:09] markmont@umich.edu This problem causes all tests in ext/standard/tests/math to fail: <?php define('LONG_MAX', is_int(5000000000)? 9223372036854775807 : 0x7FFFFFFF); define('LONG_MIN', -LONG_MAX - 1); printf("%d,%d,%d,%d\n",is_int(LONG_MIN ),is_int(LONG_MAX ), is_int(LONG_MIN-1),is_int(LONG_MAX+1)); printf( "LONG_MIN = %ld, LONG_MIN - 1 = %ld\n", LONG_MIN, LONG_MIN - 1 ); printf( "LONG_MAX = %ld, LONG_MAX + 1 = %ld\n", LONG_MAX, LONG_MAX + 1 ); ?> This script gives the following results on my system: 1,1,1,1 LONG_MIN = -9223372036854775808, LONG_MIN - 1 = 9223372036854775807 LONG_MAX = 9223372036854775807, LONG_MAX + 1 = -9223372036854775808 Here's my setup: PHP 4.1.0 compiled as a 64-bit stand-alone interpreter (CGI). Hardware: Sun Blade 1000 (750MHz UltraSparc III processor) OS: Solaris 8 07/01, running a 64-bit kernel Compiler: Sun Forte 6 update 2 env CC="cc -fast -xtarget=generic64" CFLAGS="-v -I/opt/include" \ CXX="CC -fast -xtarget=generic64 -v" \ LDFLAGS="-R/opt/lib/sparcv9 -R/opt/lib -L/opt/lib/sparcv9 -L/opt/lib" \ ac_cv_path_install='/usr/sbin/install' \ ./configure --prefix=/opt/packages/php-4.1.0 \ --enable-force-cgi-redirect --enable-discard-path --enable-trans-sid \ --with-config-file-path=/opt/www/etc \ --with-exec-dir=/opt/packages/php-4.1.0/bin --with-mm=/opt --with-zlib \ --with-zlib-dir=/opt --with-expat-dir=/opt --with-mysql --with-gdbm=/opt \ --with-gd=yes --enable-gd-native-ttf --with-xpm-dir=/opt \ --with-jpeg-dir=/opt --with-png-dir=/opt --with-freetype-dir=/opt \ --enable-freetype-4bit-antialias-hack I hope this helps. Any thoughts as to what the problem could be? If I can be of help in fixing it, just let me know. Thanks! ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=14630&edit=1

« previous php.bugs (#16225) next »