Skip to content

Commit 148dcc3

Browse files
ellishgbjoernQ
authored andcommitted
Implement floor() using libm (esp-rs#272)
1 parent c297b08 commit 148dcc3

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

esp-wifi/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ embassy-sync = { workspace = true, optional = true }
2929
embassy-futures = { workspace = true, optional = true }
3030
embassy-net-driver = { workspace = true, optional = true }
3131
toml-cfg.workspace = true
32+
libm.workspace = true
3233

3334
[features]
3435
default = [ "utils", "log" ]

esp-wifi/src/common_adapter/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,6 @@ pub unsafe extern "C" fn strrchr(_s: *const (), _c: u32) -> *const u8 {
457457

458458
#[no_mangle]
459459
#[linkage = "weak"]
460-
pub unsafe extern "C" fn floor(_v: f64) -> f64 {
461-
todo!("floor")
460+
pub unsafe extern "C" fn floor(v: f64) -> f64 {
461+
libm::floor(v)
462462
}

0 commit comments

Comments
 (0)