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.
This commit is contained in:
Stephen Williams 2008-08-30 17:35:57 -07:00
parent 319b886118
commit c0a4b7c670
1 changed files with 1 additions and 1 deletions

View File

@ -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);