Skip to content

Commit e112434

Browse files
authoredOct 11, 2020
Add tests to Math (#423)
* Add prettier config * test: add test to check for absolute function * chore: es5 to es6 * test: add test to check mean function * test: add test for sum of digit * test: add test for factorial * test: add test for fibonnaci * test: add test for find HCF * test: add test for lcm * test: add gridget test * test: add test for mean square error * test: add test for modular binary exponentiation * test: add tests for palindrome * test: add test for pascals triangle * test: add tests for polynomial * test: add tests for prime check * test: add tests for reverse polish notation * test: add tests for sieve of eratosthenes * test: add tests for pi estimation monte carlo method * chore: move tests to test folder * chore: fix standardjs errors
1 parent 554abf7 commit e112434

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+420
-172
lines changed
 

‎.prettierrc

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"arrowParens": "always",
3+
"bracketSpacing": true,
4+
"endOfLine": "lf",
5+
"insertPragma": false,
6+
"printWidth": 80,
7+
"proseWrap": "preserve",
8+
"quoteProps": "as-needed",
9+
"requirePragma": false,
10+
"semi": false,
11+
"singleQuote": true,
12+
"tabWidth": 2,
13+
"trailingComma": "none",
14+
"useTabs": false
15+
}

‎Maths/Abs.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
https://en.wikipedia.org/wiki/Absolute_value
1212
*/
1313

14-
function absVal (num) {
14+
const absVal = (num) => {
1515
// Find absolute value of `num`.
1616
'use strict'
1717
if (num < 0) {
@@ -21,6 +21,4 @@ function absVal (num) {
2121
return num
2222
}
2323

24-
// Run `abs` function to find absolute value of two numbers.
25-
console.log('The absolute value of -34 is ' + absVal(-34))
26-
console.log('The absolute value of 34 is ' + absVal(34))
24+
export { absVal }

0 commit comments

Comments
 (0)
Please sign in to comment.