MCPcopy Index your code
hub / github.com/RustPython/RustPython / bigint_to_finite_float

Function bigint_to_finite_float

crates/common/src/int.rs:149–151  ·  view source on GitHub ↗
(int: &BigInt)

Source from the content-addressed store, hash-verified

147// num-bigint now returns Some(inf) for to_f64() in some cases, so just keep that the same for now
148#[inline(always)]
149pub fn bigint_to_finite_float(int: &BigInt) -> Option<f64> {
150 int.to_f64().filter(|f| f.is_finite())
151}
152
153#[cfg(test)]
154mod tests {

Callers 1

try_to_floatFunction · 0.85

Calls 3

to_f64Method · 0.80
filterMethod · 0.45
is_finiteMethod · 0.45

Tested by

no test coverage detected