hassan Posted August 3, 2015 Share Posted August 3, 2015 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 More sharing options...
chop Posted August 3, 2015 Share Posted August 3, 2015 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. 1 Link to comment Share on other sites More sharing options...
hassan Posted August 3, 2015 Author Share Posted August 3, 2015 Hi thanks for the reply I think I understand seems very complex is it just matter of rounding off numbers? By normal I did mean integers :-) Link to comment Share on other sites More sharing options...
Larry Posted August 3, 2015 Share Posted August 3, 2015 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 More sharing options...
hassan Posted August 5, 2015 Author Share Posted August 5, 2015 Ok I think I get now ... Thanks Link to comment Share on other sites More sharing options...
Recommended Posts