def expln(x):
 def f(val):
  if (val < 0):
   return exp(val)
  else:
   return (log((val + 1.0)) + 1)
 try:
  result = array(list(map(f, x)))
 except TypeError:
  result = array(f(x))
 return result

def expln ( x ) : def f ( val ) : if ( val < 0 ) : return exp ( val ) else : return ( log ( ( val + 1.0 ) ) + 1 ) try : result = array ( list ( map ( f , x ) ) ) except TypeError : result = array ( f ( x ) ) return result
this continuous function ensures that the values of the array are always positive .