Re: Variables

From: Date: Thu, 08 Jun 2000 15:16:23 +0000
Subject: Re: Variables
References: 1  Groups: php.windows php.windows 
Request: Send a blank email to php-windows+get-351@lists.php.net to get a copy of this message
Mikkel Erup wrote: > > 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 > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net > For additional commands, e-mail: php-windows-help@lists.php.net > To contact the list administraX-Mozilla-Status: 0009-admin@lists.php.net see setlocale () function in manual. -- Stas Trefilov Moscow Russia

« previous php.windows (#351) next »