[package]
edition = "2024"
rust-version = "1.85"
name = "decimal-scaled"
version = "0.3.2"
build = "build.rs"
exclude = [
".github/",
"bash.exe.stackdump",
"research/",
"tarpaulin.toml",
"scripts/",
"docs/benchmarks*.draft",
]
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "Const-generic base-10 fixed-point decimals (D9/D18/D38/D76/D153/D307) with integer-only transcendentals correctly rounded to within 0.5 ULP — exact at the type's last representable place. Deterministic across every platform; no_std-friendly."
homepage = "https://github.com/mootable/decimal-scaled"
documentation = "https://mootable.github.io/decimal-scaled/"
readme = "README.md"
keywords = [
"decimal",
"fixed-point",
"deterministic",
"no-std",
"precision",
]
categories = [
"mathematics",
"no-std",
"science",
"finance",
]
license = "MIT OR Apache-2.0"
repository = "https://github.com/mootable/decimal-scaled"
[package.metadata.docs.rs]
features = [
"std",
"serde",
"strict",
"macros",
"wide",
"x-wide",
"xx-wide",
]
rustdoc-args = [
"--cfg",
"docsrs",
]
[features]
alloc = []
bench-alt = []
d114 = []
d1231 = []
d153 = []
d230 = []
d307 = []
d461 = []
d56 = []
d615 = []
d76 = []
d923 = []
default = [
"std",
"serde",
"strict",
]
experimental-floats = []
fast = []
macros = ["dep:decimal_scaled_macros"]
perf-trace = ["dep:tracing"]
rounding-ceiling = []
rounding-floor = []
rounding-half-away-from-zero = []
rounding-half-toward-zero = []
rounding-trunc = []
serde = ["dep:serde"]
std = ["alloc"]
strict = []
wide = [
"d56",
"d76",
"d114",
"d153",
"d230",
]
x-wide = [
"d307",
"d461",
"d615",
]
xx-wide = [
"d923",
"d1231",
]
[lib]
name = "decimal_scaled"
path = "src/lib.rs"
[[example]]
name = "chart_gen"
path = "examples/chart_gen.rs"
[[example]]
name = "divbench"
path = "examples/divbench.rs"
[[example]]
name = "expbench"
path = "examples/expbench.rs"
[[example]]
name = "fast_vs_strict_ulp"
path = "examples/fast_vs_strict_ulp.rs"
[[example]]
name = "karabench"
path = "examples/karabench.rs"
[[example]]
name = "profile_atan_perfetto"
path = "examples/profile_atan_perfetto.rs"
[[example]]
name = "profile_exp"
path = "examples/profile_exp.rs"
[[example]]
name = "profile_exp_perfetto"
path = "examples/profile_exp_perfetto.rs"
[[example]]
name = "rounding_mode_probe"
path = "examples/rounding_mode_probe.rs"
[[example]]
name = "sqrtbench"
path = "examples/sqrtbench.rs"
[[example]]
name = "test_pi"
path = "examples/test_pi.rs"
[[example]]
name = "ulp_report"
path = "examples/ulp_report.rs"
[[test]]
name = "arithmetic_mode_aware"
path = "tests/arithmetic_mode_aware.rs"
[[test]]
name = "bitwise"
path = "tests/bitwise.rs"
[[test]]
name = "conversion_error_display"
path = "tests/conversion_error_display.rs"
[[test]]
name = "conversions"
path = "tests/conversions.rs"
[[test]]
name = "decimal_trait_default_methods"
path = "tests/decimal_trait_default_methods.rs"
[[test]]
name = "decimal_trait_generic_surface"
path = "tests/decimal_trait_generic_surface.rs"
[[test]]
name = "edge_cases"
path = "tests/edge_cases.rs"
[[test]]
name = "equalities"
path = "tests/equalities.rs"
[[test]]
name = "equalities_wide_branches"
path = "tests/equalities_wide_branches.rs"
[[test]]
name = "macros"
path = "tests/macros.rs"
[[test]]
name = "macros_bitwise_and_overflow"
path = "tests/macros_bitwise_and_overflow.rs"
[[test]]
name = "macros_int_and_conversions"
path = "tests/macros_int_and_conversions.rs"
[[test]]
name = "macros_num_traits"
path = "tests/macros_num_traits.rs"
[[test]]
name = "macros_pow"
path = "tests/macros_pow.rs"
[[test]]
name = "macros_surface"
path = "tests/macros_surface.rs"
[[test]]
name = "narrow_fast_transcendentals"
path = "tests/narrow_fast_transcendentals.rs"
[[test]]
name = "narrow_strict_transcendentals"
path = "tests/narrow_strict_transcendentals.rs"
[[test]]
name = "new_tiers_smoke"
path = "tests/new_tiers_smoke.rs"
[[test]]
name = "num_traits"
path = "tests/num_traits.rs"
[[test]]
name = "parse_errors"
path = "tests/parse_errors.rs"
[[test]]
name = "precision_strict_05_ulp"
path = "tests/precision_strict_05_ulp.rs"
[[test]]
name = "precision_wide_baseline"
path = "tests/precision_wide_baseline.rs"
[[test]]
name = "rescale"
path = "tests/rescale.rs"
[[test]]
name = "rescale_modes"
path = "tests/rescale_modes.rs"
[[test]]
name = "rounding_mode_matrix"
path = "tests/rounding_mode_matrix.rs"
[[test]]
name = "routing_surface"
path = "tests/routing_surface.rs"
[[test]]
name = "serde_surface"
path = "tests/serde_surface.rs"
[[test]]
name = "wide_constants_all_six"
path = "tests/wide_constants_all_six.rs"
[[test]]
name = "wide_constants_high_scale"
path = "tests/wide_constants_high_scale.rs"
[[test]]
name = "wide_roots_dispatcher_and_hypot"
path = "tests/wide_roots_dispatcher_and_hypot.rs"
[[test]]
name = "wide_strict_transcendentals"
path = "tests/wide_strict_transcendentals.rs"
[[test]]
name = "widen_narrow_default"
path = "tests/widen_narrow_default.rs"
[[bench]]
name = "agm_vs_taylor"
path = "benches/agm_vs_taylor.rs"
harness = false
required-features = ["x-wide"]
[[bench]]
name = "all_functions"
path = "benches/all_functions.rs"
harness = false
[[bench]]
name = "atan_inputs"
path = "benches/atan_inputs.rs"
harness = false
required-features = ["wide"]
[[bench]]
name = "d_w128_mul_div_paths"
path = "benches/d_w128_mul_div_paths.rs"
harness = false
required-features = ["wide"]
[[bench]]
name = "decimal_backends"
path = "benches/decimal_backends.rs"
harness = false
required-features = ["wide"]
[[bench]]
name = "full_matrix_common"
path = "benches/full_matrix_common.rs"
[[bench]]
name = "full_matrix_d114"
path = "benches/full_matrix_d114.rs"
harness = false
required-features = ["wide"]
[[bench]]
name = "full_matrix_d1231"
path = "benches/full_matrix_d1231.rs"
harness = false
required-features = ["xx-wide"]
[[bench]]
name = "full_matrix_d153"
path = "benches/full_matrix_d153.rs"
harness = false
[[bench]]
name = "full_matrix_d18"
path = "benches/full_matrix_d18.rs"
harness = false
[[bench]]
name = "full_matrix_d230"
path = "benches/full_matrix_d230.rs"
harness = false
required-features = ["wide"]
[[bench]]
name = "full_matrix_d307"
path = "benches/full_matrix_d307.rs"
harness = false
[[bench]]
name = "full_matrix_d38"
path = "benches/full_matrix_d38.rs"
harness = false
[[bench]]
name = "full_matrix_d461"
path = "benches/full_matrix_d461.rs"
harness = false
required-features = ["x-wide"]
[[bench]]
name = "full_matrix_d56"
path = "benches/full_matrix_d56.rs"
harness = false
required-features = ["wide"]
[[bench]]
name = "full_matrix_d615"
path = "benches/full_matrix_d615.rs"
harness = false
required-features = ["x-wide"]
[[bench]]
name = "full_matrix_d76"
path = "benches/full_matrix_d76.rs"
harness = false
[[bench]]
name = "full_matrix_d9"
path = "benches/full_matrix_d9.rs"
harness = false
[[bench]]
name = "full_matrix_d923"
path = "benches/full_matrix_d923.rs"
harness = false
required-features = ["xx-wide"]
[[bench]]
name = "g_math_comparison"
path = "benches/g_math_comparison.rs"
harness = false
required-features = ["wide"]
[[bench]]
name = "lib_cmp_common"
path = "benches/lib_cmp_common.rs"
[[bench]]
name = "lib_cmp_d114"
path = "benches/lib_cmp_d114.rs"
harness = false
required-features = ["wide"]
[[bench]]
name = "lib_cmp_d1231"
path = "benches/lib_cmp_d1231.rs"
harness = false
required-features = ["xx-wide"]
[[bench]]
name = "lib_cmp_d153"
path = "benches/lib_cmp_d153.rs"
harness = false
required-features = ["wide"]
[[bench]]
name = "lib_cmp_d18"
path = "benches/lib_cmp_d18.rs"
harness = false
[[bench]]
name = "lib_cmp_d230"
path = "benches/lib_cmp_d230.rs"
harness = false
required-features = ["wide"]
[[bench]]
name = "lib_cmp_d307"
path = "benches/lib_cmp_d307.rs"
harness = false
required-features = ["wide"]
[[bench]]
name = "lib_cmp_d38"
path = "benches/lib_cmp_d38.rs"
harness = false
[[bench]]
name = "lib_cmp_d461"
path = "benches/lib_cmp_d461.rs"
harness = false
required-features = ["x-wide"]
[[bench]]
name = "lib_cmp_d56"
path = "benches/lib_cmp_d56.rs"
harness = false
required-features = ["wide"]
[[bench]]
name = "lib_cmp_d615"
path = "benches/lib_cmp_d615.rs"
harness = false
required-features = ["x-wide"]
[[bench]]
name = "lib_cmp_d76"
path = "benches/lib_cmp_d76.rs"
harness = false
required-features = ["wide"]
[[bench]]
name = "lib_cmp_d9"
path = "benches/lib_cmp_d9.rs"
harness = false
[[bench]]
name = "lib_cmp_d923"
path = "benches/lib_cmp_d923.rs"
harness = false
required-features = ["xx-wide"]
[[bench]]
name = "m2_ln_approx"
path = "benches/m2_ln_approx.rs"
harness = false
required-features = ["wide"]
[[bench]]
name = "m2_mul_fixed"
path = "benches/m2_mul_fixed.rs"
harness = false
required-features = [
"wide",
"x-wide",
"xx-wide",
"bench-alt",
]
[[bench]]
name = "mul_div_candidates"
path = "benches/mul_div_candidates.rs"
harness = false
[[bench]]
name = "quick_div"
path = "benches/quick_div.rs"
harness = false
required-features = [
"wide",
"x-wide",
"xx-wide",
]
[[bench]]
name = "wide_int_backends"
path = "benches/wide_int_backends.rs"
harness = false
required-features = ["wide"]
[dependencies.decimal_scaled_macros]
version = "0.3.2"
optional = true
default-features = false
[dependencies.num-traits]
version = "0.2"
default-features = false
[dependencies.serde]
version = "1"
features = ["derive"]
optional = true
[dependencies.tracing]
version = "0.1"
features = ["std"]
optional = true
default-features = false
[dev-dependencies.bigdecimal]
version = "0.4"
[dev-dependencies.bnum]
version = "0.14"
default-features = false
[dev-dependencies.criterion]
version = "0.8"
features = [
"cargo_bench_support",
"html_reports",
]
default-features = false
[dev-dependencies.dashu-float]
version = "0.4"
[dev-dependencies.decimal-rs]
version = "0.1"
[dev-dependencies.fastnum]
version = "0.4"
features = ["std"]
default-features = false
[dev-dependencies.fixed]
version = "1"
[dev-dependencies.g_math]
version = "0.4"
[dev-dependencies.i256]
version = "0.2"
default-features = false
[dev-dependencies.plotters]
version = "0.3"
features = [
"bitmap_backend",
"bitmap_encoder",
"line_series",
"ttf",
]
default-features = false
[dev-dependencies.postcard]
version = "1"
features = ["alloc"]
default-features = false
[dev-dependencies.ruint]
version = "1"
default-features = false
[dev-dependencies.rust_decimal]
version = "1"
features = ["maths"]
default-features = false
[dev-dependencies.scientific]
version = "0.5"
[dev-dependencies.serde_json]
version = "1"
[dev-dependencies.tracing-chrome]
version = "0.7"
[dev-dependencies.tracing-subscriber]
version = "0.3"
features = ["std"]
default-features = false
[lints.clippy]
assertions_on_constants = "allow"
bool_assert_comparison = "allow"
bool_to_int_with_if = "allow"
cast_lossless = "allow"
cast_possible_truncation = "allow"
cast_possible_wrap = "allow"
cast_precision_loss = "allow"
cast_sign_loss = "allow"
collapsible_if = "allow"
comparison_chain = "allow"
doc_lazy_continuation = "allow"
doc_markdown = "allow"
empty_line_after_outer_attr = "allow"
float_cmp = "allow"
format_push_string = "allow"
inline_always = "allow"
items_after_statements = "allow"
manual_assert = "allow"
manual_let_else = "allow"
many_single_char_names = "allow"
missing_errors_doc = "allow"
missing_panics_doc = "allow"
module_name_repetitions = "allow"
must_use_candidate = "allow"
nonminimal_bool = "allow"
result_unit_err = "allow"
return_self_not_must_use = "allow"
semicolon_if_nothing_returned = "allow"
should_panic_without_expect = "allow"
similar_names = "allow"
too_many_lines = "allow"
uninlined_format_args = "allow"
unreadable_literal = "allow"
[lints.rust]
dead_code = "allow"
unused_variables = "allow"
[profile.release]
debug = 2