rain-math-float 0.1.12

Decimal floating-point arithmetic for Rainlang / DeFi smart contracts. Packs a 224-bit signed coefficient and 32-bit signed exponent into a single bytes32, with exact decimal semantics (no NaN, Infinity, or negative zero — operations error on nonsense). Rust bindings delegate to the Solidity reference via an in-memory EVM so on-chain and off-chain results match exactly.
Documentation
[package]
name = "rain-math-float"
version = "0.1.12"
edition = "2021"
license = "LicenseRef-DCL-1.0"
description = "Decimal floating-point arithmetic for Rainlang / DeFi smart contracts. Packs a 224-bit signed coefficient and 32-bit signed exponent into a single bytes32, with exact decimal semantics (no NaN, Infinity, or negative zero — operations error on nonsense). Rust bindings delegate to the Solidity reference via an in-memory EVM so on-chain and off-chain results match exactly."
homepage = "https://github.com/rainlanguage/rain.math.float.deploy"
repository = "https://github.com/rainlanguage/rain.math.float.deploy"

[features]
# Exposes the TestDecimalFloat harness (packLossless / unpack / the log tables)
# and the artifact override in `evm.rs` outside `cfg(test)`, for a consumer
# running these bindings' tests over its own build of the concrete.
test-harness = ["dep:serde_json"]

[lib]
crate-type = ["rlib"]

[dependencies]
alloy = { version = "1.0.9", default-features = false, features = [
  "sol-types",
  "json",
  "json-abi",
] }
thiserror = "2.0.12"
serde_json = { version = "1.0.140", optional = true }
serde = "1.0.219"
# wasm-bindgen must be a direct dependency: the #[wasm_bindgen] macro emits
# `::wasm_bindgen` paths, and without a direct dep on the crate they fail to
# resolve and the macro recurses without bound on opaque-class structs (Float).
wasm-bindgen = "0.2.122"
wasm-bindgen-utils = "0.1.2"

[target.'cfg(not(target_family = "wasm"))'.dependencies]
revm = { version = "36", default-features = false, features = [
  "c-kzg",
  "portable",
  "std",
  "tracer",
] }

[target.'cfg(target_family = "wasm")'.dependencies]
# revm 36 dropped the pure-Rust kzg-rs backend; the C-based c-kzg can't target
# wasm. DecimalFloat doesn't use the KZG point-evaluation precompile, so no KZG
# backend is enabled for wasm.
revm = { version = "36", default-features = false, features = [
  "portable",
  "std",
  "tracer",
] }
getrandom = { version = "0.2.11", features = ["js", "js-sys"] }

[dev-dependencies]
alloy = { version = "1.0.9", default-features = false, features = [
  "sol-types",
  "json",
  "json-abi",
  "arbitrary",
] }
anyhow = "1.0.98"
proptest = "1.7.0"
serde_json = "1.0.140"