Skip to content

Commit

Permalink
fak smth is wrong with mpfr
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiayang committed Mar 22, 2019
1 parent 5dfc71c commit 9e56a77
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions source/typecheck/literals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ TCResult ast::LitNumber::typecheck(sst::TypecheckState* fs, fir::Type* infer)
size_t bits = mpfr_min_prec(mpfr::mpreal(this->num.substr(0, this->num.size() - 1) + "9").mpfr_ptr());

printf("number %s: %d / %d\n", number.toString().c_str(), sgn, bits);

printf("bits for %s: %d\n", this->num.c_str(), mpfr_min_prec(mpfr::mpreal(this->num).mpfr_ptr()));

auto ret = util::pool<sst::LiteralNumber>(this->loc, (infer && infer->isPrimitiveType()) ? infer : fir::ConstantNumberType::get(sgn, flt, bits));
ret->num = mpfr::mpreal(this->num);

Expand Down

0 comments on commit 9e56a77

Please sign in to comment.