Skip to content

WeDu-official/fractionalstd2inner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fractionalstd2inner

A high-performance Cython + GMP, very basic and custom implementation of Python’s built-in fractions library.
It is ~1.5× to 4× faster than the standard Python implementation and was made to be used internally by
td2inner.

⚠️ This package must be compiled locally.
No prebuilt wheels are provided.


⚠️ Important Notice (Read This First)

fractionalstd2inner contains a native Cython extension that depends on
GMP (GNU Multiple Precision Arithmetic Library).

Because of this:

  • No prebuilt wheels
  • Development tools are required
  • Compilation occurs during pip install

This is intentional.


🧩 Requirements

General

  • Python ≥ 3.10
  • C / C++ compiler
  • Cython ≥ 3.2
  • GMP development headers

INSTALLMENT STEPS

1 INSTALL DEPENDENCIES ASSUMING YOU ALREADY HAVE PYTHON AND PIP

Arch Linux

sudo pacman -S gmp base-devel cython

Ubuntu/Debian/Mint

sudo apt update
sudo apt install -y libgmp-dev build-essential python3-dev cython3

Fedora

sudo dnf install -y gcc gcc-c++ make automake gmp-devel python3-devel cython

CentOS/ RHEL

sudo yum groupinstall "Development Tools" -y
sudo yum install -y gmp-devel python3-devel cython

openSUSE

sudo zypper install -y gcc gcc-c++ make gmp-devel python3-devel cython

Windows(YOU NEED TO DOWNLOAD MSYS2) THEN

pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-make mingw-w64-x86_64-gmp mingw-w64-x86_64-python3-cython

MacOS(YOU NEED TO DOWNLOAD Homebrew(brew)) THEN

xcode-select --install
brew install gmp cython python

2 INSTALL THE LIBRARY ITSELF VIA PIP

python3 -m pip install fractionalstd2inner

3 VERIFY INSTALLATION VIA

python3 -c "import fractionalstd2inner; print(fractionalstd2inner.__version__)"

About

A basic version of Python’s 'fractions` and it's fast, used by td2inner.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors