As a part of improving an eliptical curve library I have taken to implementing a reducible math library for 384 bit numbers.
Division is not complete and will only work for numbers of roughly same size (see comments in code).
The library deals with positive whole integers since this will ultimatley be used in finite field math however the subtraction are included here in case someone wants to use this library for a different purpose. The edge case behavior ought to be tuned however for your desired use case.
git clone git@github.com:0xNonCents/multi-precision_cairo.git
cd multi-precision_cairo
To test
pytest
Directories and files
/lib/BigInt6.cairo - A struct representing a 384 bit unsigned integer
/lib/multi_precision.cairo - Math operations pertaining to this struct
/contracts/multi_precision.cairo - A test harness contract
/test/test_multi_precision.py - Tests for each multi_precision operation