Closed amoura closed 6 years ago
Thanks, I'll take a look!
This was a really good catch. The issue wasn't actually the scanning but the way floats were printed in the C code generator. I checked in a fix which just uses the exact string data from the Ion source.
The following program illustrates the issue:
`import libc {...}
func main() { x := 1.0d; y := x + 1e-10d; printf("x=%.12f y=%.12f\n", x, y); printf("y-x = %.12f\n", y-x);
}`
The printf's work as expected, but the assertion fails. This is the output: `x=1.000000000000 y=1.000000000000
y-x = 0.000000000000
ionprobl: /home/amoura/ion-probl/tst.ion:9: main: Assertion `(fabs((y) - (x))) < (0.000000)' failed.
Aborted (core dumped) ` It looks like while scanning the assertion, the literal 2e-10d is scanned as 0.000000.