Update calculator.js
This commit is contained in:
		
							parent
							
								
									888383a44e
								
							
						
					
					
						commit
						e75a7da978
					
				| 
						 | 
				
			
			@ -1,25 +1,36 @@
 | 
			
		|||
function add () {
 | 
			
		||||
function add (a,b) {
 | 
			
		||||
	return a+b;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function subtract (a,b) {
 | 
			
		||||
	return a-b;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function sum (a) {
 | 
			
		||||
	let sum=0
 | 
			
		||||
	if(a){
 | 
			
		||||
         sum+=a;
 | 
			
		||||
	}
 | 
			
		||||
	return sum;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function multiply (a,b) {
 | 
			
		||||
	return a*b;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function power(a,b) {
 | 
			
		||||
	return Math.pow(a,b)
 | 
			
		||||
	
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function subtract () {
 | 
			
		||||
	
 | 
			
		||||
function factorial(a) {
 | 
			
		||||
	if(a==o)return;
 | 
			
		||||
	let fact=1;
 | 
			
		||||
	for(let i=n ;i<0 ;i--)
 | 
			
		||||
	{ 
 | 
			
		||||
	  fact*=1;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
function sum () {
 | 
			
		||||
	
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function multiply () {
 | 
			
		||||
	
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function power() {
 | 
			
		||||
	
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function factorial() {
 | 
			
		||||
	
 | 
			
		||||
	return fact;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
module.exports = {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue