Created
April 6, 2010 22:29
-
-
Save kronos/358205 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| static VALUE | |
| fix_lshift(val, width) | |
| long val; | |
| unsigned long width; | |
| { | |
| if (width > (sizeof(VALUE)*CHAR_BIT-1) | |
| || ((unsigned long)val)>>(sizeof(VALUE)*CHAR_BIT-1-width) > 0) { | |
| return rb_big_lshift(rb_int2big(val), ULONG2NUM(width)); | |
| } | |
| val = val << width; | |
| return LONG2NUM(val); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment