Multi-limb arithmetic for runtime (#3743)

* First working version of all operations.

* New and improved version of everything.

* Minor cleanup.

* Fix build

* Finalize nignum

* Some final works on refactors and tests.

* fix build

* Some review comments

* Bench, better try into and nits

* mutify the API

* rename to big_uint

* unmutify.

* Remove resize

* Apply suggestions from code review

* Update core/sr-primitives/src/sr_arithmetic.rs

Co-Authored-By: thiolliere <gui.thiolliere@gmail.com>

* BEtter proof

* Fix panic doc.

* Bump.
This commit is contained in:
Kian Paimani
2019-10-10 09:52:08 +02:00
committed by GitHub
parent 4da48dd9f5
commit 21fae718c4
5 changed files with 1014 additions and 210 deletions
+8 -2
View File
@@ -19,6 +19,10 @@
#![warn(missing_docs)]
#![cfg_attr(not(feature = "std"), no_std)]
// to allow benchmarking
#![cfg_attr(feature = "bench", feature(test))]
#[cfg(feature = "bench")] extern crate test;
#[doc(hidden)]
pub use codec;
#[cfg(feature = "std")]
@@ -59,13 +63,15 @@ pub use generic::{DigestItem, Digest};
pub use primitives::{TypeId, crypto::{key_types, KeyTypeId, CryptoType}};
pub use app_crypto::RuntimeAppPublic;
/// Re-export arithmetic stuff.
/// Re-export top-level arithmetic stuff.
pub use sr_arithmetic::{
Perquintill, Perbill, Permill, Percent,
Rational128, Fixed64
};
/// Re-export 128 bit helpers from sr_arithmetic
/// Re-export 128 bit helpers.
pub use sr_arithmetic::helpers_128bit;
/// Re-export big_uint stiff.
pub use sr_arithmetic::biguint;
#[cfg(feature = "std")]
pub use externalities::set_and_run_with_externalities;
File diff suppressed because it is too large Load Diff