-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: add support for
no_std
environments
- Loading branch information
Showing
5 changed files
with
107 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,34 @@ | ||
[package] | ||
name = "bigdecimal" | ||
version = "0.3.0" | ||
version = "0.4.0" | ||
authors = ["Andrew Kubera"] | ||
description = "Arbitrary precision decimal numbers" | ||
documentation = "https://docs.rs/bigdecimal" | ||
homepage = "https://github.com/akubera/bigdecimal-rs" | ||
repository = "https://github.com/akubera/bigdecimal-rs" | ||
keywords = ["mathematics", "numerics", "decimal", "arbitrary-precision", "floating-point"] | ||
keywords = [ | ||
"mathematics", | ||
"numerics", | ||
"decimal", | ||
"arbitrary-precision", | ||
"floating-point", | ||
"no-std", | ||
] | ||
license = "MIT/Apache-2.0" | ||
|
||
[dependencies] | ||
num-bigint = "0.4" | ||
num-integer = "0.1" | ||
num-traits = "0.2" | ||
serde = { version = "1.0", optional = true } | ||
libm = "0.2.6" | ||
num-bigint = { version = "0.4", default-features = false } | ||
num-integer = { version = "0.1", default-features = false } | ||
num-traits = { version = "0.2", default-features = false } | ||
serde = { version = "1.0", optional = true, default-features = false } | ||
|
||
[dev-dependencies.serde_json] | ||
version = "1.0" | ||
[dev-dependencies] | ||
serde_json = "1.0" | ||
siphasher = { version = "0.3.10", default-features = false } | ||
|
||
[features] | ||
default = ["std"] | ||
alloc = [] | ||
string-only = [] | ||
std = ["num-bigint/std", "num-integer/std", "num-traits/std", "serde/std"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
extern crate alloc; | ||
|
||
use alloc::{format, string, vec}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
use std::{cmp, convert, default, fmt, hash, num, ops, iter, str, string, i8, f32, f64}; | ||
|
||
#[cfg(test)] | ||
use std::collections::hash_map::DefaultHasher; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
use core::{cmp, convert, default, fmt, hash, num, ops, iter, str, i8, f32, f64}; | ||
|
||
#[cfg(test)] | ||
extern crate siphasher; | ||
|
||
#[cfg(test)] | ||
use siphasher::sip::SipHasher as DefaultHasher; | ||
|
||
// Without this import we get the following error: | ||
// error[E0599]: no method named `powi` found for type `f64` in the current scope | ||
use num_traits::float::FloatCore; |