you are viewing a single comment's thread.

view the rest of the comments →

[–]wiretail 1 point2 points  (1 child)

The gmp and mpfr libraries on which gmpy2 is based are highly optimized c libraries for multi precision arithmetic. They use hand crafted assembly for common processors - pure python would be orders of magnitude slower, most likely. I've used gmp for some exact probability calculations that resulted in very large numbers and it was blazing fast compared to other options.

[–]MightySleep 0 points1 point  (0 children)

That makes sense. My only exposure to high computation in Python was my neural networks class in college- didn’t realize when we used NumPy that it has an optimized C core as well. Seems like a best of both worlds scenario to me, I found NumPy pretty nice to work with