Permalink
Browse files

Fix a bug in vector evaluation of abs().

The calculation of the abs of a signed value
was inverting the value if it was signed,
and not if it was negative.
  • Loading branch information...
steveicarus committed Aug 31, 2008
1 parent 319b886 commit c0a4b7c6700447750dc77c614053e8b6f5adbbb5
Showing with 1 addition and 1 deletion.
  1. +1 −1 eval_tree.cc
View
@@ -1775,7 +1775,7 @@ NetExpr* evaluate_abs(NetExpr*arg)
NetEConst*tmpi = dynamic_cast<NetEConst *>(arg);
if (tmpi) {
verinum arg = tmpi->value();
- if (arg.has_sign()) {
+ if (arg.is_negative()) {
arg = v_not(arg) + verinum(1);
}
return new NetEConst(arg);

0 comments on commit c0a4b7c

Please sign in to comment.