First time here? Check out the FAQ!

Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

answered 12 years ago

Jason Grout gravatar image

I'm seeing int(s) take about 1.5ms, which doesn't seem that slow, and is about 500x faster than str(n): http://aleph.sagemath.org/?q=3a483609-1c61-490a-bfa7-07dfe2fc484d

click to hide/show revision 2
No.2 Revision

I'm seeing int(s) take about 1.5ms, which doesn't seem that slow, and is about 500x faster than str(n): http://aleph.sagemath.org/?q=3a483609-1c61-490a-bfa7-07dfe2fc484d

Wait, there is a big problem in my timing code.

click to hide/show revision 3
No.3 Revision

I'm seeing int(s) take about 1.5ms, which doesn't seem that slow, and a long time, but Integer(s) is about 500x faster than str(n): http://aleph.sagemath.org/?q=3a483609-1c61-490a-bfa7-07dfe2fc484drelatively quick: http://aleph.sagemath.org/?q=3ddbbfe6-0640-4700-bef4-1ead8214737c

Wait, there is a big problem in my timing code.

click to hide/show revision 4
No.4 Revision

I'm seeing int(s) take a long time, but Integer(s) is relatively quick: http://aleph.sagemath.org/?q=3ddbbfe6-0640-4700-bef4-1ead8214737c

On my computer, Sage's Integer(s) talks about half the time that Mathematica's ToExpression[s] takes.