Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Apress/beginning-rust-2e
/ f
Function
f
Source Code/09-19.rs:4–7 ·
view source on GitHub ↗
(x: f64)
Source
from the content-addressed store, hash-verified
2
4 0*/
3
fn main() {
4
fn f(x: f64) -> f64 {
5
if x <= 0. { 0. }
6
else { x + 3. }
7
}
8
print!(
"{} {}"
, f(1.), f(-1.));
9
}
Callers
nothing calls this directly
Calls
no outgoing calls
Tested by
no test coverage detected