Re: LONGINT... ? to be or not to be?...
| From: | Papp Gyozo | Date: | Tue, 28 Aug 2001 22:51:50 +0000 |
| Subject: | Re: LONGINT... ? to be or not to be?... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-64914@lists.php.net to get a copy of this message | ||
Hello,
you should check the latest version of the manual:
http://www.php.net/manual/en/language.types.integer.php
more precisely and specifically the "integer overflow" section.
I think, you should use the arbitrary precision integer extension.
http://www.php.net/manual/en/ref.gmp.php
hth
----- Original Message -----
From: Alexey Prohorenko <green@usa.dp.ua>
To: <php-general@lists.php.net>
Sent: Tuesday, August 28, 2001 8:47 PM
Subject: [PHP] LONGINT... ? to be or not to be?...
> Hello,
>
> I have one question. How can PHP work with longint (in C we call
> them "unsigned long") variables?
> F.e., I want to do next thing:
>
> 65536 & 4096 = 0 (this is right)
> 65536 & 65536 = 65536 (again, everything is okay)
> 196608 & 65536 = 65536 (perfect, it works great)
>
> but,
>
> 3221225472 & 1073741824 = 0 (this is wrong, right answer isn't 0
> but 2147483648)
>
> So, can anybody help me with this? Any suggestions?
>
> Thanks, anyway. Looking forward your answers.
> Will check my mailbox every 5 minutes. :-)
>
> --
> green
> [http://www.extrasy.net]
> [http://www.unix-how-to.net]
>
> --
> 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
>