note 34737 added to function.printf

From: Date: Tue, 05 Aug 2003 13:15:06 +0000
Subject: note 34737 added to function.printf
Groups: php.notes 
Request: Send a blank email to php-notes+get-53412@lists.php.net to get a copy of this message
Found a Bug on PHP Version 4.2.3 using Win2k: printf and sprintf does the following: echo sprintf("%1.2f\n", 1.005); /* output is 1.00 (FALSE) */ printf("%1.2f\n", 1.015); /* output is 1.01 (FALSE) */ printf("%1.2f\n", 2.015); /* output is 2.02 (TRUE) */ echo sprintf("%1.2f\n", 1.025); /* output is 1.02 (FALSE) */ printf("%1.2f\n", 1.035); /* output is 1.03 (FALSE) */ echo sprintf("%1.2f\n", 1.045); /* output is 1.04 (FALSE) */ printf("%1.2f\n", 1.055); /* output is 1.05 (FALSE) */ echo sprintf("%1.2f\n", 1.065); /* output is 1.06 (FALSE) */ printf("%1.2f\n", 1.075); /* output is 1.07 (FALSE) */ echo sprintf("%1.2f\n", 1.085); /* output is 1.08 (FALSE) */ printf("%1.2f\n", 1.095); /* output is 1.09 (FALSE) */ ... and so on ... STRANGE!!! ---- Manual Page -- http://www.php.net/manual/en/function.printf.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+34737 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+34737&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+34737&report=yes

« previous php.notes (#53412) next »