Ask Your Question

malloc123's profile - activity

2020-12-04 18:04:28 +0200 received badge  Popular Question (source)
2020-12-04 18:04:28 +0200 received badge  Notable Question (source)
2018-04-30 18:49:58 +0200 received badge  Student (source)
2018-04-30 18:23:33 +0200 asked a question Can I convert integermod_int to int?

I need to do an and operation between element of vector with IntegerModRing(mynumber), but I get

if(element==(element & 3)): TypeError: unsupported operand type(s) for &: 'sage.rings.finite_rings.integer_mod.IntegerMod_int' and 'int'

don't mind element ==element(&3) It's just to see if works.

for element in v0:
  if(element==(element & 3)):
    print "ok"

is there a function that let me do this?