Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

BUG: Converting large integer to np.longdouble can raise ValueError #28639

Open
Labels
@user202729

Description

@user202729

Describe the issue:

In [3]: import numpy as np   ...: np.longdouble(int(10)**int(4301))

raise the following warning

---------------------------------------------------------------------------ValueError                                Traceback (most recent call last)Cell In[3], line 2      1 import numpy as np----> 2 np.longdouble(int(10)**int(4301))ValueError: Exceeds the limit (4300 digits) for integer string conversion; use sys.set_int_max_str_digits() to increase the limit

with the default setting (namelysys.set_int_max_str_digits(4300)).

Reproduce the code example:

Asabove

Error message:

As above

Python and NumPy Versions:

Python 3.13.1, numpy 2.2.2

Runtime Environment:

doesn't matter

Context for the issue:

In#10723 a function to properly convert Python int to longdouble was implemented, it is correct but slow, and relies on round-trip conversion to decimal. Of course this is to be expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp