Web Hosting Talk







View Full Version : PHP question.


Cms
12-29-2002, 02:37 AM
Since we are on the subject of PHP, how would i use LONG's in php? i wrote a counter and never expected to get that many hits, but it's happened. ;*)

ChickenSteak
12-29-2002, 02:44 AM
Wrong category there mate, by the way could you rephrase your question?

Cms
12-29-2002, 02:47 AM
How would i use LONG datatypes?
How do i declare them?
Instead of plane integers.

inverus
12-29-2002, 02:54 AM
No such thing as a "long" type in PHP.

ints will go from -2147483647 to 2147483647... If that isn't enough, as the php manual says "If you specify a number beyond the bounds of the integer type, it will be interpreted as a float instead." Floats can be much larger (around 1.8e308)

phpa
12-29-2002, 06:44 AM
You can also just store numbers as strings and use the bcmath routines to operate on numbers of infinite magnitude.

Note also that referring to a long datatype is meaningless when attempting to convey numeric range as it's language/platform dependent, and is commonly taken to be 32 bits, and the same size as an int.