| 1 | initial version |
This is because random.randint(0,3^15-1) returns a Python int and not a Sage Integer. To fix this, you can either
int into a Sage Integer, by replacing random.randint(0,3^15-1) with ZZ(random.randint(0,3^15-1))or
random.randint(0,3^15-1) with ZZ.random_element(0,3^15-1) | 2 | No.2 Revision |
This is because random.randint(0,3^15-1) returns a Python int and not a Sage Integer. , and only this latter has a digits method. To fix this, you can either
int into a Sage Integer, by replacing random.randint(0,3^15-1) with ZZ(random.randint(0,3^15-1))or
random.randint(0,3^15-1) with ZZ.random_element(0,3^15-1) | 3 | No.3 Revision |
This is because random.randint(0,3^15-1) returns a Python int and not a Sage Integer, and only this latter has a digits method. To fix this, you can either
int into a Sage Integer, by replacing random.randint(0,3^15-1) with ZZ(random.randint(0,3^15-1))or
random.randint(0,3^15-1) with ZZ.random_element(0,3^15-1)ZZ.random_element(0,3^15) Note that in this case, the upper bound becomes excluded by default, so you have to remove the -1.
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.