Skip to content
Open

Done #92

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
function makeInt(n){
return parseInt(n,10)
}

function preserveDecimal(n){
return parseFloat(n)
}

function add(a,b){
return a + b
}

function substract(a, b){
return a - b
}
function multiply(a,b){
return a * b
}

function divide(a , b){
if (b !==0 ){
return a/b
}
else {
return NaN
}
}

function inc(n){
return ++n
}

function dec(n){
return --n
}
2 changes: 1 addition & 1 deletion test/index-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ it('add(a, b) adds two numbers and returns the result', function() {
})

it('subtract(a, b) subtracts b from a and returns the result', function() {
expect(subtract(a, b)).toEqual(a - b)
expect(substract(a, b)).toEqual(a - b)
})

it('multiply(a, b) multiplies two numbers and returns the result', function() {
Expand Down