Skip to content

Commit

Permalink
Add missing license and inline anotations
Browse files Browse the repository at this point in the history
  • Loading branch information
olanod committed Nov 7, 2024
1 parent 806c2f9 commit 0d98d46
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/math.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#[inline]
pub(crate) fn f32_trunc(val: f32) -> f32 {
#[cfg(feature = "std")]
{ val.round() }
#[cfg(not(feature = "std"))]
{ libm::roundf(val) }
}

#[inline]
pub(crate) fn f32_round(val: f32) -> f32 {
#[cfg(feature = "std")]
{ val.round() }
#[cfg(not(feature = "std"))]
{ libm::roundf(val) }
}

#[inline]
pub(crate) fn f64_pow(a: f64, b: f64) -> f64 {
#[cfg(feature = "std")]
{ f64::powf(a, b) }
Expand Down

0 comments on commit 0d98d46

Please sign in to comment.