Changeset 1010 for trunk/GSASIImath.py


Ignore:
Timestamp:
Jul 24, 2013 9:04:01 PM (10 years ago)
Author:
toby
Message:

more CIF work

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIImath.py

    r1003 r1010  
    12981298            valoff = 0
    12991299    if esd != 0:
     1300        if valoff+esdoff < 0:
     1301            valoff = esdoff = 0
    13001302        out = ("{:."+str(valoff+esdoff)+"f}").format(value/10**valoff) # format the value
    13011303    elif valoff != 0: # esd = 0; exponential notation ==> esdoff decimal places
    13021304        out = ("{:."+str(esdoff)+"f}").format(value/10**valoff) # format the value
    13031305    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
    13051310        if extra > 0: extra += 1
    13061311        out = ("{:."+str(max(0,esdoff+int(extra)))+"f}").format(value) # format the value
Note: See TracChangeset for help on using the changeset viewer.