From 8fe108796d9674bb828023539089b6e0636d9ea1 Mon Sep 17 00:00:00 2001 From: Christian Date: Fri, 29 Mar 2019 16:22:26 +0100 Subject: [PATCH] Added documentation on the remainder (Rem) operator for floating points. --- src/libcore/ops/arith.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libcore/ops/arith.rs b/src/libcore/ops/arith.rs index 0252edee231..007a8db6c47 100644 --- a/src/libcore/ops/arith.rs +++ b/src/libcore/ops/arith.rs @@ -537,6 +537,10 @@ rem_impl_integer! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 } macro_rules! rem_impl_float { ($($t:ty)*) => ($( + + /// The remainder from the division of two floats. + /// + /// The remainder has the same sign as the dividend. For example: `-5.0 % 2.0 = -1.0`. #[stable(feature = "rust1", since = "1.0.0")] impl Rem for $t { type Output = $t;