Reply to Re: working with array with floats

Your name:

Reply:


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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация