Variables

From: Date: Thu, 08 Jun 2000 01:34:50 +0000
Subject: Variables
Groups: php.windows 
Request: Send a blank email to php-windows+get-309@lists.php.net to get a copy of this message
Thanks Jim. That did part of the job. But <? $a = "2.2"; echo 2 * $a; ?> states 4 ?! echo 2.0 * 2.2; and echo (double)("2.0" * "2.5"); and echo ("2.0" * "2.2"); and echo "2.0" * "2.2"; all state 4 too ??? Is it a bug or what's wrong? -----Original Message----- From: "jim" <sabolchi@ptd.net> To: <mikkel.erup@mail.com> Subject: Re: [PHP-WINDOWS] Variables Date sent: Wed, 7 Jun 2000 19:28:16 -0400 try $a = "1.2"; -----Original Message----- From: Mikkel Erup <mikkel.erup@heaven.dk> To: php-windows@lists.php.net <php-windows@lists.php.net> Date: Wednesday, June 07, 2000 7:17 PM Subject: [PHP-WINDOWS] Variables I'm sending this message again, hoping that someone can reply. Should I submit a bug report or am I doing something wrong eg in the configuration? The same script works under Linux PHP4. -- Mikkel Erup ----------------------------------------------------------- Hi. I use php4 on Windows 2000. I have the following problem, which I hope someone can help me about. I use the following: <? $a = 1.2; echo $a; ?>  it states 1 ???  what's the problem. Why doesn't it state 1.2? echo gettype($a); states double, so the type should be right. Using $a = 1.2e3 or $a = (double) 1.2 gives me the same result. whenever I use doubles in expressions like $c = ($a * $b); where $a and $b are doubles it seems to be using integer values, even if I use the cast operator (double). -- Mikkel Erup

« previous php.windows (#309) next »