note 34737 deleted from function.printf by didou

From: Date: Tue, 05 Aug 2003 14:17:07 +0000
Subject: note 34737 deleted from function.printf by didou
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-53414@lists.php.net to get a copy of this message
Note Submitter: ---- 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!!!

« previous php.notes (#53414) next »