c2c_native icon indicating copy to clipboard operation
c2c_native copied to clipboard

Floating point parsing error

Open tom-from-goss opened this issue 2 years ago • 4 comments

The following code produces a syntax error

module hello;

import stdlib local;
import stdio as io;

func f32 add(f32 a, f32 b) {
	return a + b;
}

public func i32 main() {

	f32 c = add(1.1, 2);

	io.printf("The value of the first entry is %d\n", c);

	return 0;
}
main.c2:12:16: error: expected identifier
        f32 c = add(1.1, 2);
               ^

Changing 1.1 to 1.0 works

tom-from-goss avatar Apr 20 '23 15:04 tom-from-goss