def scaled_zero(mag, sign=1):
 if ((type(mag) is tuple) and (len(mag) == 4) and iszero(mag, scaled=True)):
  return ((mag[0][0],) + mag[1:])
 elif isinstance(mag, SYMPY_INTS):
  if (sign not in [(-1), 1]):
   raise ValueError('sign must be +/-1')
  (rv, p) = (mpf_shift(fone, mag), (-1))
  s = (0 if (sign == 1) else 1)
  rv = (([s],) + rv[1:])
  return (rv, p)
 else:
  raise ValueError('scaled zero expects int or scaled_zero tuple.')

def scaled_zero ( mag , sign = 1 ) : if ( ( type ( mag ) is tuple ) and ( len ( mag ) == 4 ) and iszero ( mag , scaled = True ) ) : return ( ( mag [ 0 ] [ 0 ] , ) + mag [ 1 : ] ) elif isinstance ( mag , SYMPY_INTS ) : if ( sign not in [ ( - 1 ) , 1 ] ) : raise ValueError ( 'sign must be +/-1' ) ( rv , p ) = ( mpf_shift ( fone , mag ) , ( - 1 ) ) s = ( 0 if ( sign == 1 ) else 1 ) rv = ( ( [ s ] , ) + rv [ 1 : ] ) return ( rv , p ) else : raise ValueError ( 'scaled zero expects int or scaled_zero tuple.' )
return an mpf representing a power of two with magnitude mag and -1 for precision .