diff --git a/Cargo.toml b/Cargo.toml index d50339be..c840c3cd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,6 +27,7 @@ matches = "0.1" phf = {version = "0.8", features = ["macros"]} serde = {version = "1.0", optional = true} smallvec = "1.0" +libm = "0.2" [build-dependencies] syn = { version = "1", features = ["extra-traits", "fold", "full"] } diff --git a/src/tokenizer.rs b/src/tokenizer.rs index 62f38683..2b8a79e3 100644 --- a/src/tokenizer.rs +++ b/src/tokenizer.rs @@ -11,6 +11,7 @@ use matches::matches; use std::char; use std::i32; use std::ops::Range; +use libm; /// One of the pieces the CSS input is broken into. /// @@ -1073,7 +1074,7 @@ fn consume_numeric<'a>(tokenizer: &mut Tokenizer<'a>) -> Token<'a> { break; } } - value *= f64::powf(10., sign * exponent); + value *= libm::pow(10., sign * exponent); } }