Function rustpython_common::float_ops::eq_int
source · Expand description
Equate an integer to a float.
Returns true if and only if, when converted to each others types, both are equal.
Examples
use num_bigint::BigInt;
use rustpython_common::float_ops::eq_int;
let a = 1.0f64;
let b = BigInt::from(1);
let c = 2.0f64;
assert!(eq_int(a, &b));
assert!(!eq_int(c, &b));