]> git.lizzy.rs Git - rust.git/commitdiff
Added documentation on the remainder (Rem) operator for floating points.
authorChristian <chris_veenman@hotmail.com>
Fri, 29 Mar 2019 15:22:26 +0000 (16:22 +0100)
committerChristian <chris_veenman@hotmail.com>
Fri, 29 Mar 2019 15:22:26 +0000 (16:22 +0100)
src/libcore/ops/arith.rs

index 0252edee231254a0afe3e0786e3701cd5cfb5669..007a8db6c47e79e83a179421b5e97ad29eababf5 100644 (file)
@@ -537,6 +537,10 @@ fn rem(self, other: $t) -> $t { self % other }
 
 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;