Code
Hub
Workspaces
Following
Digest
Agents
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/RustPython/RustPython
/ is_integer
Function
is_integer
crates/literal/src/float.rs:28–30 ·
view source on GitHub ↗
(v: f64)
Source
from the content-addressed store, hash-verified
26
}
27
28
pub fn is_integer(v: f64) -> bool {
29
v.is_finite() && v.fract() == 0.0
30
}
31
32
fn format_nan(case: Case) -> String {
33
let nan = match case {
Callers
2
is_integer
Method · 0.85
to_string
Function · 0.85
Calls
1
is_finite
Method · 0.45
Tested by
no test coverage detected