diff options
author | elie <elie> | 2015-04-04 10:25:29 +0000 |
---|---|---|
committer | elie <elie> | 2015-04-04 10:25:29 +0000 |
commit | 7a69bc04e598874ef7b6ab7cac1f85d9dcc532a3 (patch) | |
tree | 03617915c7ba107bfad86bfe9ad26b462aa6a501 | |
parent | c49e826a6ab89d81ecebcca483277f3934809572 (diff) | |
download | pyasn1-7a69bc04e598874ef7b6ab7cac1f85d9dcc532a3.tar.gz |
Real.prettyPrint() modified to return a floating point number
-rw-r--r-- | pyasn1/type/univ.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/pyasn1/type/univ.py b/pyasn1/type/univ.py index bc0a0f4..2897e64 100644 --- a/pyasn1/type/univ.py +++ b/pyasn1/type/univ.py @@ -631,6 +631,12 @@ class Real(base.AbstractSimpleAsn1Item): else: return str(value) + def prettyPrint(self, scope=0): + if self.isInfinity(): + return self.prettyOut(self._value) + else: + return str(float(self)) + def isPlusInfinity(self): return self._value == self._plusInf def isMinusInfinity(self): return self._value == self._minusInf def isInfinity(self): return self._value in self._inf |