From 8d1d198887fdc6778a1232e39d750f4b6f4420bf Mon Sep 17 00:00:00 2001 From: SuzBarnes Date: Tue, 31 May 2022 21:25:35 +0100 Subject: [PATCH] numbers 11 success tests --- src/numbers.js | 66 +++++++++++++++++++++++++------------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/src/numbers.js b/src/numbers.js index d3eab646..e1e214ed 100644 --- a/src/numbers.js +++ b/src/numbers.js @@ -1,46 +1,46 @@ -function add (a, b) { - // your code here -} +const add = (a, b) => { + return a+b; +}; -function subtract (a, b) { - // your code here -} +const subtract = (a, b) => { + return a-b; +}; -function multiply (a, b) { - // your code here -} +const multiply = (a, b) => { + return a*b; +}; -function divide (a, b) { - // your code here -} +const divide =(a, b) => { + return a/b; +}; -function power (a, b) { - // your code here -} +const power =(a, b) =>{ + return Math.pow (a, b); +}; -function round (a) { - // your code here -} +const round = (a) =>{ + return Math.round(a); +}; -function roundUp (a) { - // your code here -} +const roundUp = (a) =>{ + return Math.ceil(a); +}; -function roundDown (a) { - // your code here -} +const roundDown =(a)=> { + return Math.floor(a); +}; -function absolute (a) { - // your code here -} +const absolute =(a)=> { + return Math.abs(a); +}; -function quotient (a, b) { - // your code here -} +const quotient =(a, b)=> { + return Math.trunc(a/b); +}; -function remainder (a, b) { - // your code here -} +const remainder =(a, b)=> { + return a%b; +}; module.exports = { add,