Re: Negative numbers

From: Date: Tue, 02 Jan 2001 20:16:11 +0000
Subject: Re: Negative numbers
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-32325@lists.php.net to get a copy of this message
I don't know what you are doing wrong. I just did this: <?php $duration = 3000; //in sec $Break = -1800; //in sec $addon = $duration+$Break; print $addon . "\n"; ?> and it printed out "1200". Jeremy Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 :: jeremy@nirvani.net http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more Get your own Free, Private email at http://www.smackdown.com/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "<body>" -- Quoted from Yahoo! homepage, http://www.yahoo.com On Tue, 2 Jan 2001, John LYC wrote: > Date: Tue, 02 Jan 2001 11:21:58 +0800 > From: John LYC <john@edlabs.com> > To: PHP List <php-general@lists.php.net> > Subject: [PHP] Negative numbers > > > HOw do i represent and do calculation on negative values? > due to current situation i need to do this... > > > $duration = 3000; //in sec > $Break = -1800; //in sec > $addon = $duration+$Break; > > result should be 1200 > but php now returns 4800 > even when i try quoting the negative values of Break. > > john > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.general (#32325) next »