Skip to content

Commit

Permalink
Fix types in no-std build
Browse files Browse the repository at this point in the history
  • Loading branch information
akubera committed Dec 8, 2024
1 parent 1fca278 commit 50d14b5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/impl_num.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
use num_traits::{Zero, Num, Signed, FromPrimitive, ToPrimitive, AsPrimitive};
use num_bigint::{BigInt, Sign, ToBigInt};

#[cfg(not(feature = "std"))]
use num_traits::float::FloatCore;

use crate::stdlib;
use stdlib::str::FromStr;
use stdlib::string::{String, ToString};
Expand All @@ -14,8 +17,8 @@ use crate::ParseBigDecimalError;

#[cfg(not(feature = "std"))]
// f64::powi is only available in std, no_std must use libm
fn powi(x: f64, n: f64) -> f64 {
libm::pow(x, n)
fn powi(x: f64, n: i32) -> f64 {
libm::pow(x, n as f64)
}

#[cfg(feature = "std")]
Expand Down

0 comments on commit 50d14b5

Please sign in to comment.