Jump to content
Larry Ullman's Book Forums

Recommended Posts

Hi 

 

I was reading the book on page 25 the tip says:

"PHP supports a maximum integer
of around two billion on most platforms.
With numbers larger than that, PHP will
automatically use a floating-point type."
 
What is floating type? how does it differ from normal numbers?
 
Thanks in advance :-) 
Link to comment
Share on other sites

A float is a number with a decimal point in it or one expressed in exponential notation. So when numbers get really small (or really big)  like  123456789484848484884884 then, if you echo this, it would become:

1.23456789485E+23

which means that you move the decimal point 23 places to the right to get an approximation of the original number. Approximation because you'll notice that it has been rounded off at the ...484 to ...485

 

If by normal numbers you mean integers, integers do not have a decimal point though one is assumed to be at the far right.

  • Upvote 1
Link to comment
Share on other sites

It's a matter of representing the number in a different format. This may or may not have implications with respect to rounding. So all computers and languages can handle numbers in integer format within a certain range. Outside of that range, a different system has to be used to represent them. 

Link to comment
Share on other sites

 Share

×
×
  • Create New...