Vitalie Lazu wrote:
> It seems to be a bug with >> operator:
> 
> 4653896912 >> 13 should be 43814 like it is in java or php, but not
> 568102.
> 
> Tested with ruby 1.8.2 in windows xp and freebsd.
> 
> any related issues to this subject?
> 
> Best regards,
> Vitalie
> 

Why should *anything* be like java and php?

$ ruby -e 'puts 4653896912 >> 13'
568102
$ python -c 'print 4653896912 >> 13'
568102
$ ruby -e 'puts 4653896912.0 / (2**13)'
568102.650390625
$ python -c 'print 4653896912.0 / (2**13)'
568102.650391
$ echo '4653896912.0 / (2^13)' | bc
568102
$ cat t.c
main(){
  printf("%d\n", 4653896912 >> 13);
}
$ tcc -run t.c
568102

Maybe there is a bignum problem in java/php?

Perl (v5.8.7), on the other hand, seems to be in its own world...

$ perl -e 'printf "%s\n", 4653896912 >> 13'
524287

-- 
      vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407