From: Bill Zorn Date: Wed, 8 Aug 2018 08:02:36 +0000 (-0700) Subject: fix bug X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a5f0ec87770343fcf8a33f9c7a44cad8befe9afb;p=sfpy.git fix bug --- diff --git a/sfpy/posit.pyx b/sfpy/posit.pyx index d75cb09..f2f76a7 100644 --- a/sfpy/posit.pyx +++ b/sfpy/posit.pyx @@ -1032,12 +1032,12 @@ cdef class Quire32: if not isinstance(value, int): raise TypeError('expecting int, got {}'.format(repr(value))) - for idx in range(1, -1, -1): + for idx in range(7, -1, -1): obj._c_quire.v[idx] = value & 0xffffffffffffffff value >>= 64 if not (value == 0): - raise OverflowError('value too large to fit in uint64_t[2]') + raise OverflowError('value too large to fit in uint64_t[8]') return obj @@ -1049,7 +1049,7 @@ cdef class Quire32: self._c_quire.v[idx] = value & 0xffffffffffffffff value >>= 64 if not (value == 0): - raise OverflowError('value too large to fit in uint64_t[2]') + raise OverflowError('value too large to fit in uint64_t[8]') else: f = float(value) self._c_quire = cposit.q32_clr(self._c_quire)