On Mon, Sep 22, 2025 at 5:21 PM Vincent Macri <[email protected]> wrote: > > On 2025-09-22 1:06 p.m., Gareth Ma wrote: > > I replied to OP instead of the mailing list, oops. > > You can use the `gmpy2` module, namely `gmpy2.iroot(n, 3)[0]`. > > Maybe this can go in Sage somewhere, maybe a method under ZZ? > > I'm not sure if it's using gmpy2, but we do have a method under ZZ for this: > n.nth_root(3, truncate_mode=1)[0]. gmpy2 and ZZ are two different interfaces using gmp as a backend.
both gmpy2.iroot and n.nth_root call gmp's mpz_root() directly. > > -- > You received this message because you are subscribed to the Google Groups > "sage-devel" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion visit > https://groups.google.com/d/msgid/sage-devel/ea77469c-e8c1-4f7b-b1c6-fe1ee65050ff%40ucalgary.ca. -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion visit https://groups.google.com/d/msgid/sage-devel/CAAWYfq14XRbNMWAM8jB3aM9AU9nXLGtxKPxi7uOB-%3DQOMKaf%3Dg%40mail.gmail.com.
