note 23037 deleted from ref.bc by googleguy

From: Date: Tue, 22 Oct 2013 09:03:03 +0000
Subject: note 23037 deleted from ref.bc by googleguy
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-196856@lists.php.net to get a copy of this message
Note Submitter: benjcarson at digitaljunkies ca ---- Note that bcmath doesn't seem to handle numbers in exponential notation (i.e. "1e4"), although PHP considers such a value a number. example: $exp1 = "1E5"; $exp2 = "2E4"; $ans1 = bcadd($exp1, $exp2, 3); $ans2 = $exp1 + exp2; echo("bcadd: $exp1 + $exp2 = $ans1"); echo("php: $exp1 + $exp2 = $ans2"); // Output: bcadd: 1E5 + 2E4 = 0.000 php: 1E5 + 2E4 = 120000 Just a gotcha if you're using passing PHP numbers into bcmath functions...

« previous php.notes (#196856) next »