File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed 
scripts/python/function/source Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -142,8 +142,8 @@ describe('metacall', () => {
142142
143143			// Factorial composition (@trgwii) 
144144			/* 
145- 			const fact = f.function_factorial(c => v => v); 
146- 			assert.strictEqual(fact(0), 0 ); 
145+ 			const fact = f.function_factorial(c => v => v <= 0 ? 1 : v ); 
146+ 			assert.strictEqual(fact(0), 1 ); 
147147			assert.strictEqual(fact(1), 1); 
148148			assert.strictEqual(fact(2), 2); 
149149			assert.strictEqual(fact(3), 6); 
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ def function_chain(x):
3535	return  lambda  n : x (x )(n );
3636
3737def  function_factorial (x ):
38- 	return  lambda  n : 1  if  n  = =  0  else  n  *  x (x )(n  -  1 );
38+ 	return  lambda  n : 1  if  n  < =  0  else  n  *  x (x )(n  -  1 );
3939
4040class  MyClass :
4141	def  f (self ):
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments