Converting string into number does not work properly [closed]

asked 2012-06-06 07:51:08 +0200

azerbajdzan gravatar image

updated 2013-04-22 06:46:19 +0200

tmonteil gravatar image

Sage can convert huge integer number into string very quickly but the opposite way it is very slow:

n=2^7000000; s=str(n); (very fast) m=int(s); (very slow)

I also used "eval" and "sage_eval" instead of "int" with same result, i.e. converting from huge string into integer number is very slow. It should take about same time in both cases since variables n, m and s are of the same length.

Do you have any idea why is this so? Mathematica is much more faster in evaluating the above operations.

edit retag flag offensive reopen merge delete

Closed for the following reason duplicate question by kcrisman
close date 2012-06-06 10:30:50

Comments

This question is a duplicate of [1482](http://ask.sagemath.org/question/1482/converting-string-into-number-does-not-work). Just to redirect any comments/answers.

fidbc gravatar imagefidbc ( 2012-06-06 10:25:56 +0200 )edit