ScMP (Scratch Multiple Precision) is a high-performance library for arbitrary-precision arithmetics. Currently, only integers are supported. Click "see inside" for more information. - - - - - - - - - - Technical details - - - - - - - - - - ● Multiplication, division, and modular exponentiation switch between different algorithms based on the input size. ○ Multiplication: schoolbook, Karatsuba, NTT ○ Division: schoolbook, divide-and-conquer, Newton-Raphson method ○ Modular exponentiation: binary lifting, decimal lifting with pre-calculated table - - - - - - - - - - Todos - - - - - - - - - - ● Square roots ● Floating point number ● ...
The library is based on the Heap Memory Engine. https://scratch.mit.edu/projects/1033272659/ - - - - - - - - - - Credit - - - - - - - - - - ● Thanks @52525rr for NTT multiplication and Newton–Raphson method division. https://scratch.mit.edu/projects/1047224394/ - - - - - - - - - - Change Log - - - - - - - - - - v0.1 - 2025-9-21 ● The project is created.