Skip to content

Commit

Permalink
Fix docstr errs
Browse files Browse the repository at this point in the history
  • Loading branch information
sug0 committed Jan 5, 2024
1 parent 5f735e0 commit 06e6172
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions core/src/types/dec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,21 @@ impl Dec {
/// the division is impossible (e.g., division by zero or overflow), `None`
/// is returned.
///
/// Example:
/// ```
///
/// For instance:
///
/// ```ignore
/// let x = Dec::new(3, 1).unwrap(); // Represents 0.3
/// let y = Dec::new(2, 1).unwrap(); // Represents 0.2
/// let result = x.trunc_div(&y).unwrap();
/// assert_eq!(result, Dec::new(15, 1).unwrap()); // Result is 1.5 truncated to 1 decimal place
/// ```
///
/// # Arguments
///
/// * `rhs`: The right-hand side `Dec` value for the division.
///
/// # Returns
///
/// An `Option<Dec>` which is `Some` with the result if the division is
/// successful, or `None` if the division cannot be performed.
pub fn trunc_div(&self, rhs: &Self) -> Option<Self> {
Expand Down

0 comments on commit 06e6172

Please sign in to comment.