|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-03-26 17:19 UTC] derick@php.net
[2001-03-27 08:32 UTC] zeev@php.net
[2001-03-27 12:30 UTC] derick@php.net
[2002-01-09 16:36 UTC] pgerzson at freestart dot hu
[2002-01-09 16:43 UTC] gerzson@php.net
[2002-01-15 12:33 UTC] pgerzson at freestart dot hu
[2002-01-22 07:46 UTC] martin at humany dot com
[2002-06-17 06:59 UTC] hholzgra@php.net
[2002-10-14 22:48 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 10:00:02 2025 UTC |
<?php printf('%.2f',0.09999999999999999167332731531132594682276248931884765625); ?> produces '0.0:' instead of '0.10' I'm really curious as to why PHP just doesn't use libc's sprintf(). ./configure --with-oracle=/usr/local/oracle/product/8.1.7 \ --with-oci8=/usr/local/oracle/product/8.1.7 --enable-force-cgi-redirect \ --enable-track-vars --with-posix --enable-sockets --enable-sigchild \ --with-gd=/usr/local gcc version 2.95.2 19991024 (release) This is not exactly a fix... --- ext/standard/formatted_print.c Mon Mar 26 14:01:31 2001 +++ ext/standard/formatted_print.c-fixed Mon Mar 26 14:02:26 2001 @@ -92,7 +92,7 @@ while (p1 < &cvt_buf[NDIG]) *p++ = *p1++; } else if (arg > 0) { - while ((fj = arg * 10) < 1) { + while ((fj = arg * 10.0) < 0.9999999) { arg = fj; r2--; }