def _dexp(c, e, p):
 p += 2
 extra = max(0, ((e + len(str(c))) - 1))
 q = (p + extra)
 shift = (e + q)
 if (shift >= 0):
  cshift = (c * (10 ** shift))
 else:
  cshift = (c // (10 ** (- shift)))
 (quot, rem) = divmod(cshift, _log10_digits(q))
 rem = _div_nearest(rem, (10 ** extra))
 return (_div_nearest(_iexp(rem, (10 ** p)), 1000), ((quot - p) + 3))

def _dexp ( c , e , p ) : p += 2 extra = max ( 0 , ( ( e + len ( str ( c ) ) ) - 1 ) ) q = ( p + extra ) shift = ( e + q ) if ( shift >= 0 ) : cshift = ( c * ( 10 ** shift ) ) else : cshift = ( c // ( 10 ** ( - shift ) ) ) ( quot , rem ) = divmod ( cshift , _log10_digits ( q ) ) rem = _div_nearest ( rem , ( 10 ** extra ) ) return ( _div_nearest ( _iexp ( rem , ( 10 ** p ) ) , 1000 ) , ( ( quot - p ) + 3 ) )
compute an approximation to exp .