Skip to content

Commit 8fe1087

Browse files
author
Christian
committed
Added documentation on the remainder (Rem) operator for floating points.
1 parent 6c479c3 commit 8fe1087

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/libcore/ops/arith.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,10 @@ rem_impl_integer! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
537537

538538
macro_rules! rem_impl_float {
539539
($($t:ty)*) => ($(
540+
541+
/// The remainder from the division of two floats.
542+
///
543+
/// The remainder has the same sign as the dividend. For example: `-5.0 % 2.0 = -1.0`.
540544
#[stable(feature = "rust1", since = "1.0.0")]
541545
impl Rem for $t {
542546
type Output = $t;

0 commit comments

Comments
 (0)