about summary refs log tree commit diff
path: root/doc
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-04-21 12:54:51 -0700
committerbors <bors@rust-lang.org>2013-04-21 12:54:51 -0700
commit6a31525c50fc5f2e2ad63bf30ec80c1279bf1fe4 (patch)
tree5d5efc584aa00328b3df8fc6eecefb5532c19ac8 /doc
parent535244cde4640986f29978c5f9c35fd3b40f58db (diff)
parent01eb5e8ad39a57e9fc31569983c1b9d5905a7e58 (diff)
auto merge of #5990 : bjz/rust/rem-quot, r=catamorphism
This renaming, proposed in the [Numeric Bikeshed](https://github.com/mozilla/rust/wiki/Bikeshed-Numeric-Traits#rename-modulo-into-rem-or-remainder-in-traits-and-docs), will allow us to implement div and and modulo methods that follow the conventional mathematical definitions for negative numbers without altering the definitions of the operators (and confusing systems programmers). Here is a useful answer on StackOverflow that explains the difference between `div`/`mod` and `quot`/`rem` in Haskell: (When is the difference between quotRem and divMod useful?)[http://stackoverflow.com/a/339823/679485].

This is part of the numeric trait reforms tracked in issue #4819.
Diffstat (limited to 'doc')
-rw-r--r--doc/rust.md16
-rw-r--r--doc/tutorial.md2
2 files changed, 9 insertions, 9 deletions
diff --git a/doc/rust.md b/doc/rust.md
index e9c88fc3412..b1eb5521b39 100644
--- a/doc/rust.md
+++ b/doc/rust.md
@@ -1467,10 +1467,10 @@ A complete list of the built-in language items follows:
   : Elements can be subtracted.
 `mul`
   : Elements can be multiplied.
-`div`
-  : Elements can be divided.
-`mod`
-  : Elements have a modulo operation.
+`quot`
+  : Elements have a quotient operation.
+`rem`
+  : Elements have a remainder operation.
 `neg`
   : Elements can be negated arithmetically.
 `not`
@@ -1856,11 +1856,11 @@ The default meaning of the operators on standard types is given here.
   : Multiplication.
     Calls the `mul` method on the `core::ops::Mul` trait.
 `/`
-  : Division.
-    Calls the `div` method on the `core::ops::Div` trait.
+  : Quotient.
+    Calls the `quot` method on the `core::ops::Quot` trait.
 `%`
-  : Modulo (a.k.a. "remainder").
-    Calls the `modulo` method on the `core::ops::Modulo` trait.
+  : Remainder.
+    Calls the `rem` method on the `core::ops::Rem` trait.
 
 #### Bitwise operators
 
diff --git a/doc/tutorial.md b/doc/tutorial.md
index 56629b93b1a..c10bc8a294c 100644
--- a/doc/tutorial.md
+++ b/doc/tutorial.md
@@ -362,7 +362,7 @@ The nil type, written `()`, has a single value, also written `()`.
 ## Operators
 
 Rust's set of operators contains very few surprises. Arithmetic is done with
-`*`, `/`, `%`, `+`, and `-` (multiply, divide, take remainder, add, and subtract). `-` is
+`*`, `/`, `%`, `+`, and `-` (multiply, quotient, remainder, add, and subtract). `-` is
 also a unary prefix operator that negates numbers. As in C, the bitwise operators
 `>>`, `<<`, `&`, `|`, and `^` are also supported.