mirror of
https://github.com/rust-lang/book.git
synced 2026-11-30 20:04:31 -06:00
Only say 'remainder', not 'modulo'
Fixes #269. See http://stackoverflow.com/questions/13683563/whats-the-difference-between-mod-and-remainder/13683709#13683709 In Rust, `-21 % 4` results in -1.
This commit is contained in:
@@ -129,7 +129,7 @@ Floating-point numbers are represented according to the IEEE-754 standard. The
|
||||
|
||||
Rust supports the usual basic mathematic operations you’d expect for all of
|
||||
these number types: addition, subtraction, multiplication, division, and
|
||||
modulo. This code shows how you'd use each one in a `let` statement:
|
||||
remainder. This code shows how you'd use each one in a `let` statement:
|
||||
|
||||
Filename: src/main.rs
|
||||
|
||||
@@ -147,7 +147,7 @@ fn main() {
|
||||
// division
|
||||
let quotient = 56.7 / 32.2;
|
||||
|
||||
// modulo
|
||||
// remainder
|
||||
let remainder = 43 % 5;
|
||||
}
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user