Lines Matching refs:expo
36 """Return (sign, intpart, fraction, expo) or raise an exception:
40 expo is an integer"""
46 if exppart: expo = int(exppart[1:])
47 else: expo = 0
48 return sign, intpart, fraction, expo
50 def unexpo(intpart, fraction, expo):
52 if expo > 0: # Move the point left
54 intpart, fraction = intpart + fraction[:expo], fraction[expo:]
55 if expo > f:
56 intpart = intpart + '0'*(expo-f)
57 elif expo < 0: # Move the point right
59 intpart, fraction = intpart[:expo], intpart[expo:] + fraction
60 if expo < -i:
61 fraction = '0'*(-expo-i) + fraction
96 sign, intpart, fraction, expo = extract(x)
99 intpart, fraction = unexpo(intpart, fraction, expo)
111 sign, intpart, fraction, expo = extract(x)
115 expo = expo - 1
118 expo = expo - 1
122 expo = expo + len(intpart) - 1
127 intpart, fraction, expo = \
129 expo + len(intpart) - 1
132 e = repr(abs(expo))
134 if expo < 0: e = '-' + e