Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Square and Cube roots.
#3
If you are willing to install an external library, or are working with large integer numbers, you should look at gmpy2

>>> import gmpy2
>>> gmpy2.iroot_rem(128,3)
(mpz(5), mpz(3))
iroot_rem(x,N) returns the integer part of the N-th of x and the remainder.
Reply


Messages In This Thread
Square and Cube roots. - by jarrod0987 - Apr-13-2018, 01:19 PM
RE: Square and Cube roots. - by nilamo - Apr-13-2018, 09:05 PM
RE: Square and Cube roots. - by casevh - Apr-13-2018, 09:30 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Im at square one even with trying to install python origen 1 492 Jan-12-2024, 05:39 AM
Last Post: ndc85430
  Finding all roots of a function thonpy 3 2,590 Apr-16-2021, 03:02 AM
Last Post: bowlofred
  pip unistall in alternate roots confminn 0 1,506 Aug-21-2020, 08:03 PM
Last Post: confminn
  square root of 5 input numbers mrityunjoy 1 2,130 Jun-10-2020, 11:08 AM
Last Post: perfringo
  square root of 6 input numbers mrityunjoy 3 2,759 Jun-07-2020, 06:35 AM
Last Post: ndc85430
  How to simplify square finding program? meknowsnothing 3 3,082 Jun-11-2019, 08:20 PM
Last Post: meknowsnothing
  cropping a picture (always square) Leon 1 2,239 Aug-13-2018, 10:04 AM
Last Post: Leon
  Error when trying to square a number pistacheoowalnuttanker 5 4,005 Jul-20-2018, 02:23 AM
Last Post: pistacheoowalnuttanker
  I'm having a problem with this cube root code Duc311003 2 3,059 May-16-2018, 07:13 PM
Last Post: buran
  "³" math cube symbol encoding Ragnar 5 10,031 Mar-09-2018, 04:23 PM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020