Testing `ExactRep`
- Dominant language
- Python
- Stars
- 297
- Forks
- 73
- PR merge metrics
- No merged PRs in 30d
Description
Hi All --
I'm playing with implementing some of the ideas here in PyTorch. I was looking at the `ExactRep` code and (maybe?) found an issue:
```
>>> np.__version__
'1.13.1'
>>> x = ExactRep(np.array([2.0]))
>>> a = np.array([0.5])
>>> i = 11
>>>
>>> for _ in range(i):
... _ = x.div(a)
...
>>> for _ in range(i):
... _ = x.mul(a)
...
>>> x.val
array([-0.00067149])
```
Presumably, `ExactRep` should be able to handle this situation, and correctly return `2.0`. Any ideas what might be going on? (If `i <= 10`, the code works as expected.)
Note that to get `ExactRep` to run I had to change
```
class BitStore(object):
def __init__(self, length):
...
self.store = np.array([0L] * length, dtype=object)
```
to
```
class BitStore(object):
def __init__(self, length):
...
self.store = np.array([0L] * length, dtype=long)
```
otherwise I get the error
```
TypeError: ufunc 'add' output (typecode 'O') could not be coerced to provided output parameter (typecode 'l') according to the casting rule ''same_kind''
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.