main
Last change
on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
859 bytes
|
Rev | Line | |
---|
[d24f17c] | 1 | var _curry2 =
|
---|
| 2 | /*#__PURE__*/
|
---|
| 3 | require("./internal/_curry2.js");
|
---|
| 4 | /**
|
---|
| 5 | * Divides the first parameter by the second and returns the remainder. Note
|
---|
| 6 | * that this function preserves the JavaScript-style behavior for modulo. For
|
---|
| 7 | * mathematical modulo see [`mathMod`](#mathMod).
|
---|
| 8 | *
|
---|
| 9 | * @func
|
---|
| 10 | * @memberOf R
|
---|
| 11 | * @since v0.1.1
|
---|
| 12 | * @category Math
|
---|
| 13 | * @sig Number -> Number -> Number
|
---|
| 14 | * @param {Number} a The value to the divide.
|
---|
| 15 | * @param {Number} b The pseudo-modulus
|
---|
| 16 | * @return {Number} The result of `b % a`.
|
---|
| 17 | * @see R.mathMod
|
---|
| 18 | * @example
|
---|
| 19 | *
|
---|
| 20 | * R.modulo(17, 3); //=> 2
|
---|
| 21 | * // JS behavior:
|
---|
| 22 | * R.modulo(-17, 3); //=> -2
|
---|
| 23 | * R.modulo(17, -3); //=> 2
|
---|
| 24 | *
|
---|
| 25 | * const isOdd = R.modulo(R.__, 2);
|
---|
| 26 | * isOdd(42); //=> 0
|
---|
| 27 | * isOdd(21); //=> 1
|
---|
| 28 | */
|
---|
| 29 |
|
---|
| 30 |
|
---|
| 31 | var modulo =
|
---|
| 32 | /*#__PURE__*/
|
---|
| 33 | _curry2(function modulo(a, b) {
|
---|
| 34 | return a % b;
|
---|
| 35 | });
|
---|
| 36 |
|
---|
| 37 | module.exports = modulo; |
---|
Note:
See
TracBrowser
for help on using the repository browser.