Changeset 1010 for trunk/GSASIImath.py
- Timestamp:
- Jul 24, 2013 9:04:01 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIImath.py
r1003 r1010 1298 1298 valoff = 0 1299 1299 if esd != 0: 1300 if valoff+esdoff < 0: 1301 valoff = esdoff = 0 1300 1302 out = ("{:."+str(valoff+esdoff)+"f}").format(value/10**valoff) # format the value 1301 1303 elif valoff != 0: # esd = 0; exponential notation ==> esdoff decimal places 1302 1304 out = ("{:."+str(esdoff)+"f}").format(value/10**valoff) # format the value 1303 1305 else: # esd = 0; non-exponential notation ==> esdoff+1 significant digits 1304 extra = -math.log10(abs(value)) 1306 if abs(value) > 0: 1307 extra = -math.log10(abs(value)) 1308 else: 1309 extra = 0 1305 1310 if extra > 0: extra += 1 1306 1311 out = ("{:."+str(max(0,esdoff+int(extra)))+"f}").format(value) # format the value
Note: See TracChangeset
for help on using the changeset viewer.