Crates.io | assert-be-close |
lib.rs | assert-be-close |
version | 1.0.3 |
source | src |
created_at | 2024-04-21 11:44:09.420445 |
updated_at | 2024-05-09 22:20:51.201356 |
description | A simple function to assert that two numbers are close to each other. |
homepage | https://crates.io/crates/assert-be-close |
repository | https://github.com/azishio/assert-be-close-rs |
max_upload_size | |
id | 1215318 |
size | 17,498 |
Provides functions to verify the equivalence of floating-point numbers at arbitrary precision.
任意の精度で浮動小数点数の等価性を検証するための関数を提供します。
use assert_be_close_rs::{assert_be_close, assert_not_close};
Check for equivalence with arbitrary precision.
任意の精度で等価であることを確認。
assert_be_close(1.0, 1.0001, 3);
assert_be_close(1.0, 1.0001, 4); // panic
Check for non-equivalence with arbitrary precision.
任意の精度で等価でないことを確認。
assert_not_close(1.0, 1.0001, 4);
assert_not_close(1.0, 1.0001, 3); // panic
Licensed under either of
at your option.
(The English in the README and comments in the source code were translated by DeepL.)