You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JavaScript treats floats and integers as the same type, so the following would be a simple test for a real number:
497
+
Listed below are a few common sets and their symbols.
498
+
499
+
#### `ℝ` real numbers
500
+
501
+
The large `ℝ` describes the set of *real numbers*. These include integers, as well as rational and irrational numbers.
502
+
503
+
JavaScript treats floats and integers as the same type, so the following would be a simple example of our *k* ∈ ℝ example:
498
504
499
505
```js
500
506
typeof k ==='number'
501
507
```
502
508
503
-
Aside form `ℝ` for real numbers, here are a few common sets to be aware of:
504
-
505
-
##### `ℚ` rational numbers
509
+
#### `ℚ` rational numbers
506
510
507
-
A real number that can be written as a fraction or *ratio* (like `⅗`). The denominator cannot be zero.
511
+
Rational numbers are real numbers that can be expressed as a fraction, or *ratio* (like `⅗`). Rational numbers cannot have a denominator of zero.
508
512
509
513
This also means that all integers are rational numbers, since the denominator can be expressed as 1.
510
514
511
-
##### `ℤ` integers
515
+
An irrational number, on the other hand, is one that cannot be expressed as a ratio, like π (PI).
516
+
517
+
#### `ℤ` integers
512
518
513
519
An integer, i.e. a real number that has no fractional part. These can be positive or negative.
514
520
@@ -520,7 +526,7 @@ function isInteger (n) {
520
526
}
521
527
```
522
528
523
-
#####`ℕ` natural numbers
529
+
#### `ℕ` natural numbers
524
530
525
531
A natural number, a positive and non-negative integer. Depending on the context and field of study, the set may or may not include zero, so it could look like either of these:
526
532
@@ -537,7 +543,7 @@ function isNaturalNumber (n) {
537
543
}
538
544
```
539
545
540
-
#####`ℂ` complex numbers
546
+
#### `ℂ` complex numbers
541
547
542
548
A complex number is a combination of a real number and an imaginary number. For more info, see [A Visual, Intuitive Guide to Imaginary Numbers](http://betterexplained.com/articles/a-visual-intuitive-guide-to-imaginary-numbers/).
543
549
@@ -640,7 +646,7 @@ function sgn (x) {
640
646
}
641
647
```
642
648
643
-
See [signum](https://github.com/scijs/signum) for this as a module.
649
+
See [signum](https://github.com/scijs/signum) for this function as a module.
644
650
645
651
Other examples of special functions: *sin*, *cos*, *tan*.
646
652
@@ -676,6 +682,8 @@ In programming, the *domain* and *codomain* might be seen as the *input* and *ou
676
682
677
683
<!-- sgn : \mathbb{R} \rightarrow \mathbb{Z} -->
678
684
685
+
The arrow here, without a tail, is used to map one *set* to another.
686
+
679
687
In JavaScript and other dynamically typed languages, you might use documentation and/or runtime checks to explain and validate the input/output.
680
688
681
689
```js
@@ -694,7 +702,7 @@ function square (a) {
694
702
695
703
Some tools like [flowtype](http://flowtype.org/) attempt to bring static typing into JavaScript.
696
704
697
-
Other languages, like Java, allow for true method overloading based on the static types of a function's input/output. This is closer to mathematics, since two functions are not the same if they use a different *domain*.
705
+
Other languages, like Java, allow for true method overloading based on the static types of a function's input/output. This is closer to mathematics: two functions are not the same if they use a different *domain*.
698
706
699
707
## prime
700
708
@@ -730,7 +738,11 @@ function fPrime (x) {
730
738
731
739
Multiple prime symbols can be used to describe the second derivative *ƒ′′* and third derivative *ƒ′′′*. After this, authors typically express higher orders with roman numerals *ƒ*<sup>IV</sup> or superscript numbers *ƒ*<sup>(n)</sup>.
732
740
733
-
## equality arrows
741
+
## lines & arrows
742
+
743
+
We have already seen some arrows in the [function notation](#function-notation) section. Here are a few other variations.
744
+
745
+
#### equality
734
746
735
747
In math, the `<``>``≤` and `≥` are typically used in the same way we use them in code: *less than*, *greater than*, *less than or equal to* and *greater than or equal to*, respectively.
0 commit comments