RE: Need unrounded precision

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



bitwise right shift is probably the fastest cast to int so far ... still in many languages, intval is a function call

being a cast in both cases (int) is good as well ... bitwise, casting, works with strings, arrays, boolean, whatever as well.

I don't think there is any difference in php, except when the integer is "too big" ... but this was not the case, we had to deal with 1 to 10 :-)

Regards



> From: jbozza@xxxxxxxxxxxxx
> To: an_red@xxxxxxxxxxx
> CC: php-general@xxxxxxxxxxxxx
> Date: Mon, 12 Oct 2009 11:33:10 -0500
> Subject: RE:  Need unrounded precision
> 
> >> Hmmm... Didn't think about this, but % only works with int values
> >
> >it was just future prof precaution since this statement is false for many other languages.
> >In few words I am not sure PHP6 does the same ... never mind so far
> 
> Good to know.  In that case, I would probably just use intval() instead of >> since it's clearer and bitwise shifts aren't necessarily integer only either.
> 
> Jaime
> 
 		 	   		  
_________________________________________________________________
Windows Live: Make it easier for your friends to see what you’re up to on Facebook.
http://www.microsoft.com/middleeast/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-xm:SI_SB_2:092009

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux