Skip to content

Commit

Permalink
Add Scalar::sqrt
Browse files Browse the repository at this point in the history
  • Loading branch information
hannobraun committed Jan 7, 2025
1 parent 9f41b81 commit f734573
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions experiments/2024-12-09/src/math/scalar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ impl Scalar {
pub fn value(&self) -> f64 {
self.value
}

#[allow(unused)] // code to use it is being worked on
pub fn sqrt(self) -> Self {
let value = self.value().sqrt();
Self::new(value)
}
}

impl Eq for Scalar {}
Expand Down

0 comments on commit f734573

Please sign in to comment.