提交 e523802f authored 作者: Frédéric Bastien's avatar Frédéric Bastien

Merge pull request #1514 from lamblin/fix_1510

Use half_nbits floats instead of nbits. fixes gh-1510
...@@ -304,7 +304,7 @@ class Scalar(Type): ...@@ -304,7 +304,7 @@ class Scalar(Type):
bool operator ==(const complex_type &y) const { bool operator ==(const complex_type &y) const {
return (this->real == y.real) && (this->imag == y.imag); return (this->real == y.real) && (this->imag == y.imag);
} }
bool operator ==(const npy_float%(nbits)s &y) const { bool operator ==(const scalar_type &y) const {
return (this->real == y) && (this->imag == 0); return (this->real == y) && (this->imag == 0);
} }
complex_type operator -(const complex_type &y) const { complex_type operator -(const complex_type &y) const {
...@@ -414,6 +414,8 @@ class Scalar(Type): ...@@ -414,6 +414,8 @@ class Scalar(Type):
return "" return ""
def c_code_cache_version(self): def c_code_cache_version(self):
# Fix gh-1510, use half_nbits float instead of nbits
return (11, numpy.__version__)
# Use the correct type checking and conversion functions # Use the correct type checking and conversion functions
return (10, numpy.__version__) return (10, numpy.__version__)
# Make operators work with 64 and 128 arguments at the same time # Make operators work with 64 and 128 arguments at the same time
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论