Code generation rounding off values
Closed this issue · 5 comments
sa2257 commented
Generated code for let PI: double = 3.1415926535
rounds off to double PI = 3.1415927
.
rachitnigam commented
Changing the EFloat syntax node to take in Double instead of Float should fix it.
sa2257 commented
Hmm.. changed https://github.com/cucapra/seashell/blob/254f3b543e7ffe17d88620626529b2f9aed4f632/src/main/scala/common/Syntax.scala#L108 float
to double
. It gave me double PI = 3.1415927410125732
😕.
rachitnigam commented
Jesus Christ. What is this mess. I’ll take a look.
sampsyo commented
That's a tricky solution, but it'll do! Nice work.
rachitnigam commented
The issue with just changing the AST node to hold double was that parser was still using toFloat.
Changing that to toDouble also makes the whole thing work but we don’t inspect floating values right now so no reason to keep them in the AST.