Closed zzy444626905 closed 1 week ago
Why do you think it's an issue? IIUC, on your system get_max_precision() shows 2147483391
. But:
>>> 2147483391 < 10000000000 * 4
True
On my laptop:
Python 3.12.5+ (heads/3.12:0181aa2e3e, Aug 29 2024, 14:55:08) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from gmpy2 import *
>>> get_max_precision()
9223372036854775551
>>> get_context().precision = 10000000000 * 4 # no error
>>>
So, please at least provide more information on you system.
Why do you think it's an issue? IIUC, on your system get_max_precision() shows
2147483391
. But:>>> 2147483391 < 10000000000 * 4 True
On my laptop:
Python 3.12.5+ (heads/3.12:0181aa2e3e, Aug 29 2024, 14:55:08) [GCC 12.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from gmpy2 import * >>> get_max_precision() 9223372036854775551 >>> get_context().precision = 10000000000 * 4 # no error >>>
So, please at least provide more information on you system.
Python 3.12.3
Python 3.12.3 | packaged by conda-forge | (main, Apr 15 2024, 18:20:11) [MSC v.1938 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from gmpy2 import *
>>> get_max_precision()
2147483391
主机名: zzy
OS 名称: Microsoft Windows 10 专业版
OS 版本: 10.0.19042 暂缺 Build 19042
OS 制造商: Microsoft Corporation
OS 配置: 成员工作站
OS 构建类型: Multiprocessor Free
注册的所有人: IT
注册的组织: QXB
产品 ID: 00331-10000-00001-AA596
初始安装日期: 2021/10/25, 10:28:43
系统启动时间: 2024/8/19, 9:03:11
系统制造商: LENOVO
系统型号: 20S1A0M8CD
系统类型: x64-based PC
Could you please try pip install gmpy2
? You miss gmpy2 version, but I would guess it's v2.1.5 (old stable release).
pip install gmpy2
Could you please try
pip install gmpy2
? You miss gmpy2 version, but I would guess it's v2.1.5 (old stable release).
(yolov8) C:\Users\zzy\Desktop\python-toolbox>pip install gmpy2
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple/
Requirement already satisfied: gmpy2 in d:\miniforge3\envs\yolov8\lib\site-packages (2.2.0)
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple/ Requirement already satisfied: gmpy2 in d:\miniforge3\envs\yolov8\lib\site-packages (2.2.0)
Up to date stable version on PyPI is 2.2.1. Ok, it seems gmpy2 wasn't installed from conda-forge, right?
Anyway, I don't see anything wrong. You are on win32, where long's are 32-bit (ULONG_MAX = 2**32 - 1
). So, maximal precision is ((ULONG_MAX -1) >> 1) - 256 == 2147483391
. It's not a bug.
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple/ Requirement already satisfied: gmpy2 in d:\miniforge3\envs\yolov8\lib\site-packages (2.2.0)
Up to date stable version on PyPI is 2.2.1. Ok, it seems gmpy2 wasn't installed from conda-forge, right?
Anyway, I don't see anything wrong. You are on win32, where long's are 32-bit (
ULONG_MAX = 2**32 - 1
). So, maximal precision is((ULONG_MAX -1) >> 1) - 256 == 2147483391
. It's not a bug.
code
output: