Don't acept negative or positive infinity as a real.

This commit is contained in:
Victorien Elvinger
2015-07-06 18:09:15 +02:00
parent 0f985c6ad9
commit ee71794ec7

View File

@@ -518,10 +518,12 @@ Listed below are a few common sets and their symbols.
The large `` describes the set of *real numbers*. These include integers, as well as rational and irrational numbers.
JavaScript treats floats and integers as the same type, so the following would be a simple example of our *k* example:
JavaScript treats floats and integers as the same type, so the following would be a simple test of our *k* example:
```js
typeof k === 'number'
function isReal (k) {
return typeof k === 'number' && isFinite(k);
}
```
#### `` rational numbers
@@ -931,4 +933,4 @@ MIT, see [LICENSE.md](http://github.com/Jam3/math-as-code/blob/master/LICENSE.md
[1]: http://mimosa-pudica.net/improved-oren-nayar.html#images
[2]: http://buzzard.ups.edu/courses/2007spring/projects/million-paper.pdf
[3]: https://www.math.washington.edu/~morrow/464_12/fft.pdf
[3]: https://www.math.washington.edu/~morrow/464_12/fft.pdf