Commit Graph

5 Commits

Author SHA1 Message Date
Julien Fischer
9b12ff1b3b Fix compilation of extras/mp_int.
extras/mp_int/mp_int.m:
    Switch from math.domain_error -> exception.domain_error.

    Fix spelling.
2020-05-15 16:19:55 +10:00
Peter Wang
b74138bf98 Minor cleanups for mp_int.
extras/mp_int/mp_int.m:
	Fix a spelling mistake.

	Remove unused imports.

	Simplify implementation of divide_with_rem/4.
2015-06-06 12:18:59 +10:00
Peter Wang
d627a93193 Make mp_int constants `extern' for intermodule optimisation.
The bodies of the functions returning `mp_int' constants may be copied
into C files generated for other Mercury modules.  The globals that
they reference must be visible outside of the `mp_int' module.

extras/mp_int/mp_int.m:
	As above.
2015-06-06 12:13:31 +10:00
Peter Wang
91bf3c0c36 Remove semidet functions in mp_int module.
extras/mp_int/mp_int.m:
	Delete semidet function from_base_string/2.

	Replace semidet function from_string/1 with a predicate.
2015-06-06 12:12:09 +10:00
Matthias Güdemann
e44737eb7a Add mp_int data type based on libtommath.
This adds a new datatype mp_int for faster multi-precision integer
computations. It is based on calling the libtommath library throught the
FFI and works only in the C grades using the Boehm garbage collector.

extras/mp_int/mp_int.m:
        Add FFI binding to libtommath with API similar to integer.m

extras/mp_int/mp_int_test.m:
        Test basic functionality of mp_int.m.

extras/mp_int/README.txt:
        Description of how to download, compile and use the binding
        together with the library.

extras/README:
        Announce mp_int in extras folder.
2015-06-06 11:47:26 +10:00