-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1f02dcd
commit 6195132
Showing
8 changed files
with
189 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { add as _add } from 'arithmetic4' | ||
|
||
// re-export | ||
|
||
/** | ||
* Adds first argument and second argument. | ||
* | ||
* @param a - The first input number | ||
* @param b - The second input number | ||
* @returns The result of `a` + `b` | ||
* | ||
* @example | ||
* Basic | ||
* add(1, 2) // 3 | ||
* | ||
* @example | ||
* Curry | ||
* const plus2(2) | ||
* plus2(-3) // -1 | ||
*/ | ||
export const add = _add |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { divide as _divide } from 'arithmetic4' | ||
|
||
// re-export | ||
|
||
/** | ||
* Divide input two arguments. | ||
* | ||
* @param a - The first input number | ||
* @param b - The second input number | ||
* @returns The result of a / b | ||
* @remarks Note that when use curry, divide second argument from first argument. | ||
* @example | ||
* Basic | ||
* divide(10, 100) // 0.1 | ||
* | ||
* @example | ||
* Curry | ||
* const half = divide(2) | ||
* half(20) // 10 | ||
*/ | ||
export const divide = _divide |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export { add } from '@/add' | ||
export { divide } from '@/divide' | ||
export { multiply } from '@/multiply' | ||
export { subtract } from '@/subtract' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { multiply as _multiply } from 'arithmetic4' | ||
|
||
// re-export | ||
|
||
/** | ||
* Multiplies first argument and second argument. | ||
* | ||
* @param a - The first input number | ||
* @param b - The second input number | ||
* @returns The result of a * b | ||
* | ||
* @example | ||
* Basic | ||
* multiply(2, 3) // 6 | ||
* @example | ||
* Curry | ||
* const double = multiply(2) | ||
* double(4) // 8 | ||
*/ | ||
export const multiply = _multiply |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { subtract as _subtract } from 'arithmetic4' | ||
|
||
// re-export | ||
|
||
/** | ||
* Subtracts second argument from first argument. | ||
* | ||
* @param a - The first input number | ||
* @param b - The second input number | ||
* @returns The result of `a` - `b` | ||
* | ||
* @example | ||
* Basic | ||
* subtract(2, 1) // 1 | ||
* | ||
* @example | ||
* Curry | ||
* const minus5 = subtract(5) | ||
* minus5(10) // 5 | ||
*/ | ||
export const subtract = _subtract |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters