Skip to content

Commit cb60600

Browse files
authored
Add programming docs (#487)
1 parent 733e008 commit cb60600

File tree

4 files changed

+59
-0
lines changed

4 files changed

+59
-0
lines changed

programming/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Programming
2+
3+
Docs on programming topics

programming/config.json

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[
2+
{
3+
"uuid": "1a737701-e2f7-4021-9057-a0faf4738740",
4+
"slug": "APEX",
5+
"path": "programming/README.md",
6+
"title": "Programming docs",
7+
"blurb": "Docs on programming topics"
8+
},
9+
{
10+
"uuid": "54390764-ef34-4385-b714-ab2851bdd814",
11+
"slug": "reaminder",
12+
"path": "programming/operators/README.md",
13+
"title": "Operators",
14+
"blurb": "Docs on operators"
15+
},
16+
{
17+
"uuid": "f1848a5a-593d-411f-9d44-4d4849690e1e",
18+
"slug": "remainder",
19+
"path": "programming/operators/remainder.md",
20+
"title": "Remainder",
21+
"blurb": "The remainder operators"
22+
},
23+
]

programming/operators/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Operators
2+
3+
Docs on operators

programming/operators/remainder.md

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Remainder
2+
3+
In mathematics, the **remainder** is the amount "left over" after performing some computation.
4+
For example, the remainder of `5 / 3` is `2`.
5+
6+
Many programming languages use the percentage sign (`%`) as an operator to calculate the remainder.
7+
For example, this is valid code in Javascript and Python:
8+
```javascript
9+
5 % 3 == 2
10+
```
11+
12+
Remainders can often be calculated on both integers and floating point numbers.
13+
For example,
14+
```javascript
15+
5.3 % 3 == 2.3
16+
```
17+
18+
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).
19+
For example:
20+
```javascript
21+
-5 % 3 == -2
22+
5 % -3 == 2
23+
-5 % -3 == -2
24+
```
25+
26+
Some languages use the `%` operator for the calculating the modulus, not the remainder.
27+
This treats negative numbers differently.
28+
You can learn more about this [on Wikipedia](https://en.wikipedia.org/wiki/Modulo).
29+
30+

0 commit comments

Comments
 (0)