Porting of gmp multiprecision library to the V programming language (vlang)

Module for V (Vlang) with most of the bindings of gmp .

The suffix for the V types of numerical have been renamed according to the V names. The endings in _ui _si and _d are _u64 _i64 and _f64.

The conversion routines begin with from_ and the output routines are member functions: .i64() .u64() .f64() and .str(). This last routine get a 10-base representation. For the original mpz_get_str() there is .str_base(base int). The other names have not been changed.

The vdoc documentation gives the GMP equivalent for reference. Refer to the excellent GMP documentation .

The operators + - * / % have been overloaded.


Install the GMP on your system (for the libgmp.a file).

Locate your vmodules directory with v doctor command.

Create a gmp directory in your vmodules directory and copy in it the gmp.v and *.h files. These header files have been patched for tcc and are necessary.


GMP is under the dual licenses, GNU LGPL v3 and GNU GPL v2 . V_gmp is under the MIT-license .

Work in progress

The branch float is experimental.

To do

Porting BigRational of GMP.


last May 7