Eric Wieser
62142c5a4a
chore: add missing noexcepts ( #13370 )
...
swap and move constructors should be noexcept to enable use in STL
containers
A quick inspection suggests that these functions can never throw
exceptions anyway.
2026-05-10 17:58:04 +00:00
Rob23oba
9f06aff834
feat: optimized division without remainder for Int and Nat ( #8089 )
...
This PR adds optimized division functions for `Int` and `Nat` when the
arguments are known to be divisible (such as when normalizing
rationals). These are backed by the gmp functions `mpz_divexact` and
`mpz_divexact_ui`. See also leanprover-community/batteries#1202 .
2025-04-29 07:23:35 +00:00
Henrik Böving
93dd6f2b36
feat: add Int16/Int32/Int64 ( #5885 )
...
This adds all fixed width integers with the exception of `ssize_t` so
the code is quick to review as everything just behaves the same.
2024-11-04 13:18:05 +00:00
Henrik Böving
193b6f2bec
feat: define Int8 ( #5790 )
2024-10-25 06:06:40 +00:00
Sebastian Ullrich
8193af33e3
fix: split libInit_shared out of libleanshared ( #3421 )
...
Avoids hitting the Windows limit on symbols per shared library soon
2024-02-22 19:16:32 +00:00
Joe Hendrix
e2b3b34d14
feat: introduce native functions for Int.ediv / Int.emod ( #3376 )
...
These still need tests, but I thought I'd upstream so I can use
benchmarking and check for build errors.
2024-02-19 15:04:51 +00:00
Leonardo de Moura
8aca088752
feat: mpz missing methods for USE_GMP=OFF
2021-11-30 16:46:53 -08:00
Leonardo de Moura
e5b3b180dc
feat: some mpz methods for LEAN_USE_GMP=OFF
2021-11-29 17:55:04 -08:00
Leonardo de Moura
ec6932fbb7
feat: some mpz methods for LEAN_USE_GMP=OFF
2021-11-29 16:01:07 -08:00
Leonardo de Moura
6396f3b2c1
chore: simplify mpz.h
...
Add basic support for `LEAN_USE_GMP=OFF`.
2021-11-29 11:11:49 -08:00
Leonardo de Moura
352391bfcb
chore: remove mpz_get_d dependency
2021-10-26 12:40:20 -07:00
Leonardo de Moura
c25758e314
chore: remove mpz dead code
2021-10-26 12:28:33 -07:00
Leonardo de Moura
6d0fa6da7c
chore: remove mpz dead code
2021-10-26 12:05:19 -07:00
Leonardo de Moura
fa9c5ad21a
chore: remove mpq
2021-10-26 11:56:37 -07:00
Leonardo de Moura
f9bc4b9b3a
feat: add missing APIs
2021-09-11 15:39:11 -07:00
Leonardo de Moura
c8406a301d
chore: reduce src/include/lean
2021-09-07 08:24:54 -07:00
Leonardo de Moura
1a77ee4f89
chore: delete old runtime directory
2020-05-18 11:33:18 -07:00
Leonardo de Moura
8bdca35282
chore: use #include <lean/runtime/...> for runtime .h files
2020-05-18 11:30:07 -07:00
Leonardo de Moura
8e84a8c9ec
feat: Float from big numbers
2020-04-06 14:05:17 -07:00
Leonardo de Moura
67fb63c9fd
feat: use mpz_pow_ui to implement Nat.pow
2020-01-21 09:16:38 -08:00
Leonardo de Moura
79d4addabd
chore(runtime): fix style
2019-08-24 09:33:09 -07:00
Leonardo de Moura
720c3ca3e4
fix(runtime): size_t issue OSX vs Linux
2019-08-24 09:30:12 -07:00
Leonardo de Moura
dfbc500947
fix(runtime/mpz): (try to) fix Linux build again
2019-08-24 08:13:48 -07:00
Leonardo de Moura
dcd15f3424
refactor(runtime): C backend
2019-08-24 07:40:38 -07:00
Sebastian Ullrich
9707672cc8
fix(runtime/mpz): fix and document size_t functions
2019-07-05 16:27:04 -07:00
Sebastian Ullrich
2c9dce6eed
fix(runtime/mpz): use size_t instead of unsigned long for Windows compatibility
2019-07-05 11:24:15 +02:00
Leonardo de Moura
ee050431e0
feat(runtime): add primitive hash functions
2019-04-03 04:01:36 -07:00
Leonardo de Moura
0d5ac5288a
feat(runtime): increase small nat size
...
In 64-bit machines, the max small nat value should now be (2^63 - 1), and on 32-bit
machines (2^32 - 1).
The main motivation for this modification are the array indexing
operations. With the new representation, if a Nat index is not small,
then it must not be a valid index. This was not true in 64-bit
machines. Example: an array of size 2^33 would fit in memory, and but
an index `i` > 2^32 - 1 would not be a small nat value.
2019-03-26 14:21:03 -07:00
Leonardo de Moura
b2f3d3f456
chore(*): remove redundant code
2018-05-22 16:46:04 -07:00
Leonardo de Moura
dfc5adbd2a
feat(runtime/lean_obj): add integer primitives
2018-05-17 17:47:22 -07:00
Leonardo de Moura
0556412f8d
refactor(*): add runtime folder
...
@kha The runtime folder includes what is needed to link a
standalone Lean program. It is still contains some unnecessary files.
We will be able to remove them after we release Lean4.
2018-05-14 14:23:56 -07:00