HigherOrderCO/Bend

Strange float parsing

Closed this issue · 2 comments

Reproducing the behavior

When compiling this code to hvm:

def main:
  return 5.0 + 7.0

the result is rather... unexpected:

@main = a
  & $(7.0 a) ~ [+4235264]

It's hard to figure out what is going wrong here.

System Settings

  • Bend: 0.2.33

Additional context

Considering this bug in hvm, it might be relevant to add some basic floating point test cases.

4235264 is just the internal representation of the number 5.0, you don't need to care about it.
We already have some floating point tests

You can read the HVM paper to understand the representation used https://github.com/HigherOrderCO/HVM/blob/main/paper/PAPER.pdf. Read chapter 6