Skip to content

Commit

Permalink
Small tweak.
Browse files Browse the repository at this point in the history
  • Loading branch information
mhe committed Dec 25, 2017
1 parent 99e1de6 commit b798b1d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nrrd.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ class NrrdError(Exception):

#This will help prevent loss of precision
#IEEE754-1985 standard says that 17 decimal digits is enough in all cases.
def _to_reproducible_float( x ):
if type(x) == float:
def _to_reproducible_float(x):
if isinstance(x, float):
# Remove trailing zeros, and dot if at end
value = '{:.16f}'.format(x).rstrip('0').rstrip('.')
else:
Expand Down

0 comments on commit b798b1d

Please sign in to comment.