[PHP-WIN] Jaw Breaker - What's the ansewer?

2005-04-20 Thread JC Botha
The following is a section of PHP code (see Apache.org and PHP.net). function f($c) { $c++; if ($c % 2) { return f($c); } return $c++; } function g($n) { for ($i=1;$i<10;$i++) { $n = f($n*$i); } return ($n); } print(g($x)); What is the smallest va

[PHP-WIN] Re: Jaw Breaker - What's the ansewer?

2005-04-20 Thread M. Sokolewicz
JC Botha wrote: The following is a section of PHP code (see Apache.org and PHP.net). function f($c) { $c++; if ($c % 2) { return f($c); } return $c++; } function g($n) { for ($i=1;$i<10;$i++) { $n = f($n*$i); } return ($n); } print(g($x)); What is

Re: [PHP-WIN] Re: Jaw Breaker - What's the ansewer?

2005-04-20 Thread JC Botha
It is possible, and "10.642868165785" is incorrect. The question says "$x is a number between 1 and 10 and has 2 decimal places." Try again, if more try then I will post the source code that generates the asnwer? On 4/20/05, M. Sokolewicz <[EMAIL PROTECTED]> wrote: > JC Botha wrote: > > The fol

Re: [PHP-WIN] Re: Jaw Breaker - What's the ansewer?

2005-04-20 Thread graeme
Well the closest I got was $x = 8.36 but that only gave 4277126.8 So is this question dependent upon the floating point arithmetic that is used? graeme JC Botha wrote: It is possible, and "10.642868165785" is incorrect. The question says "$x is a number between 1 and 10 and has 2 decimal places."

Re: [PHP-WIN] Re: Jaw Breaker - What's the ansewer?

2005-04-20 Thread graeme
Yes it is an issue with floating point numbers since: 8.35 will give the answer but if you increment by .01 in a loop then you will not get the answer, when it is on 8.35. However, increment by 0.001 then 8.35 will provide the correct answer. It's all to do with how in calculates 0.01 in binary,

Re: [PHP-WIN] Re: Jaw Breaker - What's the ansewer?

2005-04-20 Thread JC Botha
Well done Graeme! Posted below is what I used to generate the asnwer, I myself had dificulty to get it. Let me know if you used another method. The Source Code == :: x = $x : $l "); } //echo ("> $x : $l"); } ?> ===

[PHP-WIN] PHP cannot load extensions

2005-04-20 Thread chistian
Hi, I've installed PhpMyAdmin 2.6.2, PHP 5.0.4 and Mysql 4.1.11 and PHP is working fine but when I try to start PhpAdmin I get this message: "PHP cannot load mysqli extensions, please controll your PHP configuration". In "Paths and directories" I wrote: extensions_dir="e:\php\ext\" and in "Dynami

[PHP-WIN] nuSoap and PHP 4.3.11

2005-04-20 Thread Charles P. Killmer
I just upgraded to 4.3.11 and now my web service apps do not work. I downloaded the latest version of nuSoap.php and still no luck. Is anyone else running into issues with this? Charles Killmer

RE: [PHP-WIN] Re: Jaw Breaker - What's the ansewer?

2005-04-20 Thread Wu, Jin Yong
It's so interesting. At the beginning, I missed the statement "$x = round($x, 2) + 0.01;", and can't get corrent answer.Then, I trace the $x value, I found its value was changed to have 13 decimal places from 4.43 on. Could you explain it for me?thank you ahead. -Original Message- From: J

Re: [PHP-WIN] PHP cannot load extensions

2005-04-20 Thread Ryan J. Cavicchioni
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Did you put "extensions=php_mysqi.dll" or "extensions=php_mysqli.dll" in the php.ini file? chistian wrote: > Hi, > > I've installed PhpMyAdmin 2.6.2, PHP 5.0.4 and Mysql 4.1.11 and PHP > is working fine but when I try to start PhpAdmin I get this >