Did I find the right examples for you? yes no

# pypy.rlib.rarithmetic.r_uint

All Samples(772)  |  Call(604)  |  Derive(0)  |  Import(168)

```"""

from pypy.rlib.rarithmetic import r_uint, r_ulonglong, intmask

```
```    def _mask(x):
"Masks the r_uint value x to keep only the lowest 32 bits."
return x & r_uint(0xffffffff)

```
```    for i in range(count):
p = start + i * 4
x = r_uint(ord(s[p]))
x |= r_uint(ord(s[p+1])) << 8
x |= r_uint(ord(s[p+2])) << 16
```

```"""

from pypy.rlib.rarithmetic import r_uint, r_ulonglong, intmask

```
```    for i in range(count):
p = start + i * 4
x = r_uint(ord(s[p]))
x |= r_uint(ord(s[p+1])) << 8
x |= r_uint(ord(s[p+2])) << 16
x |= r_uint(ord(s[p+3])) << 24
```

```from pypy.rpython.memory.gc import minimarkpage, env
from pypy.rpython.memory.support import mangle_hash
from pypy.rlib.rarithmetic import ovfcheck, LONG_BIT, intmask, r_uint
from pypy.rlib.rarithmetic import LONG_BIT_SHIFT
from pypy.rlib.debug import ll_assert, debug_print, debug_start, debug_stop
```
```        self.max_heap_size = 0.0
self.max_delta = float(r_uint(-1))
#
self.card_page_indices = card_page_indices
```
```        self.young_rawmalloced_objects = self.null_address_dict()
self.rawmalloced_total_size = r_uint(0)
#
# A list of all objects with finalizers (these are never young).
```
```        maxsize = self.nonlarge_max - raw_malloc_usage(nonvarsize)
if maxsize < 0:
toobig = r_uint(0)    # the nonvarsize alone is too big
elif raw_malloc_usage(itemsize):
toobig = r_uint(maxsize // raw_malloc_usage(itemsize)) + 1
```

```# global synonyms for some types
from pypy.rlib.rarithmetic import r_int, r_uint, r_longlong, r_ulonglong

```
```def op_uint_lshift(x, y):
assert isinstance(x, r_uint)
assert is_valid_int(y)
return r_uint(x << y)

def op_uint_rshift(x, y):
assert isinstance(x, r_uint)
assert is_valid_int(y)
return r_uint(x >> y)
```
```def op_cast_bool_to_uint(b):
assert type(b) is bool
return r_uint(int(b))

def op_cast_bool_to_float(b):
```
```def op_cast_float_to_uint(f):
assert type(f) is float
return r_uint(long(f))

def op_cast_float_to_longlong(f):
```

```from pypy.rpython.ootypesystem import ootype
from pypy.rpython.lltypesystem.lloperation import llop
from pypy.rlib.rarithmetic import ovfcheck, r_uint, intmask
from pypy.jit.metainterp.history import BoxInt, ConstInt, check_descr
from pypy.jit.metainterp.history import INT, REF, ConstFloat
```
```def do_uint_rshift(cpu, box1, box2):
v = r_uint(box1.getint()) >> r_uint(box2.getint())

# ----------
```
```def do_uint_lt(cpu, box1, box2):
return ConstInt(r_uint(box1.getint()) < r_uint(box2.getint()))

def do_uint_le(cpu, box1, box2):
return ConstInt(r_uint(box1.getint()) <= r_uint(box2.getint()))
```

```from pypy.rlib.debug import debug_start, debug_stop, ll_assert, make_sure_not_resized
from pypy.rlib.objectmodel import we_are_translated
from pypy.rlib.rarithmetic import intmask, LONG_BIT, r_uint, ovfcheck
from pypy.rlib.unroll import unrolling_iterable
```
```    def bhimpl_uint_floordiv(a, b):
c = llop.uint_floordiv(lltype.Unsigned, r_uint(a), r_uint(b))

@arguments("i", "i", returns="i")
```
```    def bhimpl_uint_rshift(a, b):
check_shift_count(b)
c = r_uint(a) >> r_uint(b)

```

```from pypy.rlib.rarithmetic import LONG_BIT, intmask, r_uint, r_ulonglong
from pypy.rlib.rarithmetic import ovfcheck, r_longlong, widen, is_valid_int
from pypy.rlib.rarithmetic import most_neg_value_of_same_type
from pypy.rlib.rfloat import isfinite
from pypy.rlib.debug import make_sure_not_resized, check_regular_int
```
```        if intval < 0:
sign = -1
ival = r_uint(-intval)
elif intval > 0:
sign = 1
ival = r_uint(intval)
```
```    def _touint_helper(self):
x = r_uint(0)
i = self.numdigits() - 1
while i >= 0:
prev = x
```
```                assert j == (i*SHIFT+4)//5*5 - i*SHIFT
#
accum = r_uint(0)
while True:
j -= 5
```

```from pypy.rlib import rgc
from pypy.rlib.jit import elidable
from pypy.rlib.rarithmetic import r_longlong, r_ulonglong, r_uint, intmask

def getargtypes(annotator, values):
```
```def _ll_1_llong_from_uint(x):
return r_longlong(r_uint(x))

def _ll_1_ullong_from_uint(x):
return r_ulonglong(r_uint(x))
```

```"""

from pypy.rlib.rarithmetic import r_uint, r_ulonglong, intmask
from pypy.rlib.unroll import unrolling_iterable

```
```    for i in range(count):
p = start + i * 4
x = r_uint(ord(s[p+3]))
x |= r_uint(ord(s[p+2])) << 8
x |= r_uint(ord(s[p+1])) << 16
x |= r_uint(ord(s[p])) << 24
```

```"""

from pypy.rlib.rarithmetic import r_uint, r_ulonglong, intmask
from pypy.rlib.unroll import unrolling_iterable

```
```    for i in range(count):
p = start + i * 4
x = r_uint(ord(s[p+3]))
x |= r_uint(ord(s[p+2])) << 8
x |= r_uint(ord(s[p+1])) << 16
x |= r_uint(ord(s[p])) << 24
```

1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next