From b798b1d1b037b8e0105016c8ecfc7973ced3671b Mon Sep 17 00:00:00 2001 From: Maarten Everts Date: Mon, 25 Dec 2017 12:33:48 +0100 Subject: [PATCH] Small tweak. --- nrrd.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nrrd.py b/nrrd.py index fda6d6e..5408da2 100644 --- a/nrrd.py +++ b/nrrd.py @@ -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: