Skip to content

Commit 7f88fde

Browse files
committed
note relation of next_multiple_of and prev_multiple_of
1 parent 93176f5 commit 7f88fde

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,10 @@ pub trait Integer: Sized + Num + PartialOrd + Ord + Eq {
195195

196196
/// Rounds up to nearest multiple of argument.
197197
///
198+
/// # Notes
199+
///
200+
/// For signed types, `a.next_multiple_of(b) = a.prev_multiple_of(b.neg())`.
201+
///
198202
/// # Examples
199203
///
200204
/// ~~~
@@ -216,6 +220,10 @@ pub trait Integer: Sized + Num + PartialOrd + Ord + Eq {
216220

217221
/// Rounds down to nearest multiple of argument.
218222
///
223+
/// # Notes
224+
///
225+
/// For signed types, `a.prev_multiple_of(b) = a.next_multiple_of(b.neg())`.
226+
///
219227
/// # Examples
220228
///
221229
/// ~~~

0 commit comments

Comments
 (0)