-
-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Programming | ||
|
||
Docs on programming topics |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
[ | ||
{ | ||
"uuid": "1a737701-e2f7-4021-9057-a0faf4738740", | ||
"slug": "APEX", | ||
"path": "programming/README.md", | ||
"title": "Programming docs", | ||
"blurb": "Docs on programming topics" | ||
}, | ||
{ | ||
"uuid": "54390764-ef34-4385-b714-ab2851bdd814", | ||
"slug": "reaminder", | ||
"path": "programming/operators/README.md", | ||
"title": "Operators", | ||
"blurb": "Docs on operators" | ||
}, | ||
{ | ||
"uuid": "f1848a5a-593d-411f-9d44-4d4849690e1e", | ||
"slug": "remainder", | ||
"path": "programming/operators/remainder.md", | ||
"title": "Remainder", | ||
"blurb": "The remainder operators" | ||
}, | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Operators | ||
|
||
Docs on operators |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Remainder | ||
|
||
In mathematics, the **remainder** is the amount "left over" after performing some computation. | ||
For example, the remainder of `5 / 3` is `2`. | ||
|
||
Many programming languages use the percentage sign (`%`) as an operator to calculate the remainder. | ||
For example, this is valid code in Javascript and Python: | ||
```javascript | ||
5 % 3 == 2 | ||
``` | ||
|
||
Remainders can often be calculated on both integers and floating point numbers. | ||
For example, | ||
```javascript | ||
5.3 % 3 == 2.3 | ||
``` | ||
|
||
When working with negative numbers, the result always has the same sign as the dividend (the number on the left hand side that is being divided). | ||
For example: | ||
```javascript | ||
-5 % 3 == -2 | ||
5 % -3 == 2 | ||
-5 % -3 == -2 | ||
``` | ||
|
||
Some languages use the `%` operator for the calculating the modulus, not the remainder. | ||
This treats negative numbers differently. | ||
You can learn more about this [on Wikipedia](https://en.wikipedia.org/wiki/Modulo). | ||
|
||
|