RE: [PHP] A little maths problem

From: Date: Tue, 15 Aug 2000 14:22:32 +0000
Subject: RE: [PHP] A little maths problem
Groups: php.general 
Request: Send a blank email to php-general+get-11807@lists.php.net to get a copy of this message
You can use printf and sprintf to print them without the decimal numbers. See the manual. At least you should be able to as it's suppose to support C style placeholders. -----Original Message----- From: Meir Kriheli - MKsoft [mailto:mksoft@netvision.net.il] Sent: Tuesday, August 15, 2000 9:02 AM To: php-general@lists.php.net Subject: Re: [PHP] A little maths problem Can't you use floating point numbers and before printint them use number_format functionto print them without the decimal point ? Meir Kriheli MKsoft computer systems 'There's someone in my head but it's not me" - Pink Floyd ----- Original Message ----- From: "Martin" <martin@thomatechnik.de> To: <php-general@lists.php.net> Sent: Tuesday, August 15, 2000 12:14 PM Subject: Re: [PHP] A little maths problem > Perry Loh wrote: > > > Any workaround to this ? > > Hm, tricky, because the largest int-number php has is 2147483647... > > > > > > > > > "Martin" <martin@thomatechnik.de> wrote in message > > news:399908FD.58F595E8@thomatechnik.de... > > > 2235957251 is binary 10000101010001100000000000000011. That means, the > > first bit > > > is set, which is interpreted as the "sign-bit" in most > > programming-languages. > > > > > > Greetings > > > > > > Martin > > > > > > > > > Perry Loh wrote: > > > > > > > A little question on maths, why does PHP return the following answer : > > > > > > > > 2634023077 xor 407240870 = -1730242778 > > > > > > > > whereas the correct result should be actually,with a calculator : > > > > > > > > 42634023077 xor 407240870 = 2235957251 > > > > > > > > I'm wondering if this is a bug, if it is or isn't , is there a > > workaround to > > > > get the correct answer ? BCMath does not seem to provide enough > > functions > > > > though. > > > > > > > > Regards > > > > -- 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 (#11807) next »