Search found 4 matches

by Julianz
Tue Oct 13, 2009 8:46 am
Forum: PHP - Code
Topic: Issues on cast / convert to SHORT type
Replies: 4
Views: 185

Re: Issues on cast / convert to SHORT type

Edit: I found a solution This is the correct function 8) 8) 8) 8) 8)   # $A = short(-252764824); # echo $A; #   # function short($number) { #     $retVal = $number & 65535; #     if ($retVal >= 32768) { #         return  ($retVal - 65536); #     } #     return $retVal; # } #   that's all 8) 8) 8...
by Julianz
Tue Oct 13, 2009 3:41 am
Forum: PHP - Code
Topic: Issues on cast / convert to SHORT type
Replies: 4
Views: 185

Re: Issues on cast / convert to SHORT type

Sorry I have another question...
This function seems work correctly, but sometimes returns a wrong value

Example:

in Java (short)(1627237980) returns ---> -20900

in PHP with this function short(1627237980); returns ---> -11868 :cry:

any suggest....? :roll:
Thanks a lot :roll:
Alan
by Julianz
Fri Sep 25, 2009 8:43 am
Forum: PHP - Code
Topic: Issues on cast / convert to SHORT type
Replies: 4
Views: 185

Re: Issues on cast / convert to SHORT type

Wonderful!!!!! Thanks a lot!! :P :P :P
by Julianz
Fri Sep 25, 2009 8:11 am
Forum: PHP - Code
Topic: Issues on cast / convert to SHORT type
Replies: 4
Views: 185

Issues on cast / convert to SHORT type

Hi everybody, I'm Italian.. and I have a big problem :( I have an application in Java and i'm trying to porting in PHP. In this application, there is a short conversion like this: A = (short)(B); the result is: 7528 = (short)(-252764824) I need to do this in PHP.... but in PHP the short type does no...