Message ID | mcrlilmyxzl.fsf@dhcp-172-18-216-180.mtv.corp.google.com |
---|---|
State | New |
Headers | show |
diff -r afcf18f60884 go/expressions.cc --- a/go/expressions.cc Mon Apr 23 09:59:25 2012 -0700 +++ b/go/expressions.cc Mon Apr 23 13:42:46 2012 -0700 @@ -13620,7 +13620,13 @@ this->clear(); this->classification_ = NC_FLOAT; this->type_ = type; - mpfr_init_set(this->u_.float_val, val, GMP_RNDN); + // Numeric constants do not have negative zero values, so remove + // them here. They also don't have infinity or NaN values, but we + // should never see them here. + if (mpfr_zero_p(val)) + mpfr_init_set_ui(this->u_.float_val, 0, GMP_RNDN); + else + mpfr_init_set(this->u_.float_val, val, GMP_RNDN); } // Set to a complex value.