Commit 654992b4 authored by dbarbera's avatar dbarbera
Browse files

Added built-in float generation

parent e92ac77a
......@@ -571,7 +571,8 @@ def generate_fix(params):
def generate_float(params):
''' Generate the code for the built-in float operation'''
raise NotImplementedError
expr_val = expression(params[0])
return g.builder.sitofp(expr_val, g.double)
def generate_power(params):
......
......@@ -160,7 +160,11 @@ COMMENT '1.0';
CALL writeln(abs(-1.0))
/* CIF COMMENT (57, 1657), (70, 35) */
COMMENT '1.0';
/* CIF NEXTSTATE (-85, 1707), (100, 50) */
/* CIF PROCEDURECALL (-104, 1707), (138, 35) */
CALL writeln(float(1))
/* CIF COMMENT (54, 1707), (70, 35) */
COMMENT '1.0';
/* CIF NEXTSTATE (-85, 1757), (100, 50) */
NEXTSTATE Wait;
ENDSTATE;
ENDPROCESS basic;
\ No newline at end of file
......@@ -33,3 +33,4 @@ TRUE
1
1.00000000000000E+00
1.00000000000000E+00
1.00000000000000E+00
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment