By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,114 Members | 1,570 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,114 IT Pros & Developers. It's quick & easy.

Problem with php 5.2.4 on wamp5 ?

P: n/a
Hi,

is there a known bug on php 5.2.4 in wamp5 (http://www.wampserver.com/
en/index.php) about having different kinds of printing for some
numeric values.

This script works perfectly on an linux based server on internet but
doesn't on my local wamp5. (here is the screnshot)
http://test03.christophe-charron.org..._bizarre_b.png

the 8100*1000 and 8200*1000 looks like "bizarre" but not 8099*1000 or
8201*1000!!
Any explanation ?

And sorry for my poor english, I'm french

Cordially,
Christophe Charron

The script :

<?php
header('Content-type: text/plain; charset=utf-8');
define('EOL', "\r\n");
multiplie("8099.000");
multiplie("8100.000");
multiplie("8200.000");
multiplie("8201.000");
multiplie("9300.000");
function multiplie($toto) {
echo ("------------------------").EOL;
$qte_stock= $toto;
echo $qte_stock.EOL;
$val_qte_stock=$qte_stock*10;
echo $val_qte_stock.EOL;
$val_qte_stock=$qte_stock*100;
echo $val_qte_stock.EOL;
$val_qte_stock=$qte_stock*1000;
echo $val_qte_stock.EOL;
echo ("double -". (double) $val_qte_stock).EOL;
$val_qte_stock=$qte_stock*10000;
echo $val_qte_stock.EOL;
echo ("double -". (double) $val_qte_stock).EOL;
echo EOL;
}
?>

Sep 22 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
WAMP is only PHP installer. Thus, while your PHP works it can't be
WAMP problem. Can you describe your goal? What do you want to achieve?

Sep 23 '07 #2

P: n/a
On 23 sep, 09:59, Meglio <x.meg...@gmail.comwrote:
WAMP is only PHP installer. Thus, while your PHP works it can't be
WAMP problem. Can you describe your goal? What do you want to achieve?
Hi,
i agree with you but wamp runs in window environment and this can
explain a difference and maybe (i don't hnow if it right) php window
version is'nt the same as linux version.
In fact, i'd like to obtain the same results on an internet linux
server http://test03.christophe-charron.org...07_09_22_b.php
than on a local window server (screenshot of the result :
http://test03.christophe-charron.org..._bizarre_b.png
The script is the same but results for 8100.000*1000 and 8200.000*1000
are different. Id like to understand the diffrence between the 2 env
and why, in my wamp env it seems to be good for 8099.000*1000 and
8201.000*1000 values !!

Cordially,
Christophe Charron

Sep 23 '07 #3

P: n/a
Christophe Charron wrote:
>
Hi,

is there a known bug on php 5.2.4 in wamp5 (http://www.wampserver.com/
en/index.php) about having different kinds of printing for some
numeric values.

This script works perfectly on an linux based server on internet but
doesn't on my local wamp5. (here is the screnshot)
http://test03.christophe-charron.org..._bizarre_b.png

the 8100*1000 and 8200*1000 looks like "bizarre" but not 8099*1000 or
8201*1000!!
Any explanation ?

And sorry for my poor english, I'm french
The result is not bizarre it is absolutely correct. The only difference
is that it is written in scientific notation.

http://en.wikipedia.org/wiki/Scientific_notation

I don't know why one PHP version switches to scientific notation earlier
than the other, but that might have something to do with the precision
setting in php.ini.

; The number of significant digits displayed in floating point numbers.
precision = 14

Check whether precision is set to the same value on both servers.

Bye!
Sep 23 '07 #4

P: n/a
On 23 sep, 11:44, Anonymous <anonym...@nowhere.invalidwrote:
Christophe Charron wrote:
Hi,
is there a known bug on php 5.2.4 in wamp5 (http://www.wampserver.com/
en/index.php) about having different kinds of printing for some
numeric values.
This script works perfectly on an linux based server on internet but
doesn't on my local wamp5. (here is the screnshot)
http://test03.christophe-charron.org..._20/2007-09-22...
the 8100*1000 and 8200*1000 looks like "bizarre" but not 8099*1000 or
8201*1000!!
Any explanation ?
And sorry for my poor english, I'm french

The result is not bizarre it is absolutely correct. The only difference
is that it is written in scientific notation.

http://en.wikipedia.org/wiki/Scientific_notation

I don't know why one PHP version switches to scientific notation earlier
than the other, but that might have something to do with the precision
setting in php.ini.

; The number of significant digits displayed in floating point numbers.
precision = 14

Check whether precision is set to the same value on both servers.

Bye!
Hi,
when i say bizarre, it is because I dont understand why php displays
scientific notation for 8100.000*1000 or 8200.000*1000 and standard
notation for 8099.000*1000 or 8201.000*1000. I'd like to understand
that !
The localeinfo() are the same for both servers and precision is 12 in
both ini files.

--
Cordially,
Christophe Charron

Sep 23 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.