Usar el módulo gmpy para números racionales


/ Published in: Python
Save to your folder(s)



Copy this code and paste it in your HTML
  1. import gmpy
  2.  
  3. num = gmpy.mpq(5,2)
  4. num2 = gmpy.mpq(10,2)
  5.  
  6. print(num+num2)

URL: http://gmpy.sourceforge.net/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.