|
Posted by Curtis on 02/01/07 04:26
On Wed, 31 Jan 2007 11:38:42 -0800, Gunnar G <debian@comhem.se> wrote:
> I have read a file with the file() command and it contains numbers, =
> numbers
> that are larger than 2^32 and now I wonder, will this be a problem if =
I =
> do
> arithemtcis, or is there some easy way to force it to use consider the=
> array as floatingpoint numbers?
>
>
Although PHP's dynamic typing should handle this properly, it might be =
useful to convert the string to an unsigned int with sprintf, if you run=
=
into issues:
/* maybe pretend we're looping */
$uintArray[] =3D sprintf('%u', trim($currentLine)); // this way, huge in=
ts =
won't become negative
This is useful when you are converting IPs to longs.
-- =
Curtis, http://dyersweb.com
Navigation:
[Reply to this message]
|