diff options
author | Clifford Wolf <clifford@clifford.at> | 2014-06-15 09:27:09 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2014-06-15 09:27:09 +0200 |
commit | 4d1df128fa42a9e6718f38e794be8b2f8c2ff7c7 (patch) | |
tree | 9c8f2c7341ce2c243e2cb3d4b5fd3860b7cfa99b /frontends | |
parent | 656685fa31b54cebf0210518d3cac8aa496dddd7 (diff) | |
download | yosys-4d1df128fa42a9e6718f38e794be8b2f8c2ff7c7.tar.gz yosys-4d1df128fa42a9e6718f38e794be8b2f8c2ff7c7.tar.bz2 yosys-4d1df128fa42a9e6718f38e794be8b2f8c2ff7c7.zip |
Improved AstNode::realAsConst for large numbers
Diffstat (limited to 'frontends')
-rw-r--r-- | frontends/ast/ast.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/frontends/ast/ast.cc b/frontends/ast/ast.cc index cc7f442bb..967111d30 100644 --- a/frontends/ast/ast.cc +++ b/frontends/ast/ast.cc @@ -808,7 +808,7 @@ RTLIL::Const AstNode::realAsConst(int width) if (is_negative) v *= -1; for (int i = 0; i < width; i++, v /= 2) - result.bits.push_back((int(v) & 1) ? RTLIL::State::S1 : RTLIL::State::S0); + result.bits.push_back((fmod(floor(v), 2) != 0) ? RTLIL::State::S1 : RTLIL::State::S0); if (is_negative) result = const_neg(result, result, false, false, result.bits.size()); } |