https://github.com/nervosnetwork/bigint
https://github.com/nervosnetwork/bigint
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/nervosnetwork/bigint
- Owner: nervosnetwork
- License: apache-2.0
- Created: 2018-05-16T06:49:55.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-11-27T15:46:57.000Z (over 7 years ago)
- Last Synced: 2025-07-25T16:02:39.504Z (about 1 year ago)
- Language: Rust
- Size: 11.7 KB
- Stars: 1
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# bigint
[](https://travis-ci.org/paritytech/primitives)
Fixed-sized integers arithmetic
To specify a dependency, add to `Cargo.toml`
```toml
[dependencies]
ethereum-types = "0.2"
```
Little example
```rust
extern crate ethereum_types;
use ethereum_types::U256;
fn main() {
let mut val: U256 = 1023.into();
for _ in 0..200 { val = val * 2.into() }
assert_eq!(
&format!("{}", val),
"1643897619276947051879427220465009342380213662639797070513307648"
);
}
```
### `no_std` crates
This crate has a feature, `std`, that is enabled by default. To use this crate
in a `no_std` context, add the following to your `Cargo.toml`:
```toml
[dependencies]
ethereum-types = { version = "4", default-features = false }
```