I was programming functions in Sage for Big numbers and found a few bugs. I emailed Jason-sage and he suggested this forum. I hope my contributions can help building a better system.
BUG: Suddenly the Python len(list) function wasn't working anymore on a simple [1,2,3] array. SOLUTION: I repasted the same code on a new Worksheet and the len() function could be called again.
BUG: I had output that was becoming very slow for mysterious reasons (a 2 to 3 seconds time lag) for some simple small values. I used t = cputime() before and cputime(t) after blocks of code and found the responsible... CODE INSIDE FUNCTION: def myfunction(num): # stops for up to 3 seconds if num == 3 t = cputime() precision = max(125, ceil(log(num,2)/2) + 10); print(cputime(t))
outside the function it is already faster, but still a bit slow the problem is the ceil() around the log() I believe, but why at 3? SOLUTION: precision = ceil(max(125, log(num,2)/2 + 10));
These bugs seem to an innocent amateur like me that Sage is an unstable system. Best Regards, GigaGerard