Skip to content

Commit

Permalink
Add Scalar::floor
Browse files Browse the repository at this point in the history
  • Loading branch information
hannobraun committed Sep 15, 2022
1 parent 1905104 commit 8b267ac
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/fj-math/src/scalar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ impl Scalar {
self.0.max(other.into().0).into()
}

/// Compute the largest integer smaller than or equal to this scalar
pub fn floor(self) -> Self {
self.0.floor().into()
}

/// Compute the smallest integer larger than or equal to this scalar
pub fn ceil(self) -> Self {
self.0.ceil().into()
Expand Down

0 comments on commit 8b267ac

Please sign in to comment.