Skip to content

Commit 37fd7b9

Browse files
Add Ramda's divide.js
1 parent c134c41 commit 37fd7b9

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

examples/ramda/divide.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import _curry2 from './internal/_curry2';
2+
3+
4+
/**
5+
* Divides two numbers. Equivalent to `a / b`.
6+
*
7+
* @func
8+
* @memberOf R
9+
* @since v0.1.0
10+
* @category Math
11+
* @sig Number -> Number -> Number
12+
* @param {Number} a The first value.
13+
* @param {Number} b The second value.
14+
* @return {Number} The result of `a / b`.
15+
* @see R.multiply
16+
* @example
17+
*
18+
* R.divide(71, 100); //=> 0.71
19+
*
20+
* var half = R.divide(R.__, 2);
21+
* half(42); //=> 21
22+
*
23+
* var reciprocal = R.divide(1);
24+
* reciprocal(4); //=> 0.25
25+
*/
26+
var divide = _curry2(#? / ?);
27+
export default divide;

0 commit comments

Comments
 (0)