number-general

Crates.ionumber-general
lib.rsnumber-general
created_at2021-01-05 04:51:49.513592
updated_at2023-12-20 05:31:16.825344
descriptionA generic number type for Rust which supports basic math and (de)serialization.
homepage
repositoryhttps://github.com/haydnv/number-general.git
max_upload_size
id331911
Haydn Vestal

documentation

README

# number-general A generic Rust number type with support for basic math operations, (de)serialization, and casting with [safecast](http://github.com/haydnv/safecast). Example usage: ```rust use number_general::{Int, Number}; use safecast::CastFrom; let sequence: Vec = serde_json::from_str("[true, 2, 3.5, -4, [1.0, -0.5]]").unwrap(); let actual = sequence.into_iter().product(); assert_eq!(actual, Number::from(num::Complex::::new(-28., 14.))); assert_eq!(Int::cast_from(actual), Int::from(-28)); ```
Commit count: 80

cargo fmt