diff --git a/lex.ll b/lex.ll index 8baa627a..129f0cd5 100644 --- a/lex.ll +++ b/lex.ll @@ -440,13 +440,13 @@ L?\"(\\.|[^\\"])*\" { lStringConst(&yylval, &yylloc); return TOKEN_STRING_LITERA {FLOAT_NUMBER} { RT; - yylval.floatVal = (float)atof(yytext); + yylval.floatVal = atof(yytext); return TOKEN_FLOAT_CONSTANT; } {HEX_FLOAT_NUMBER} { RT; - yylval.floatVal = (float)lParseHexFloat(yytext); + yylval.floatVal = lParseHexFloat(yytext); return TOKEN_FLOAT_CONSTANT; } diff --git a/parse.yy b/parse.yy index 9a2b4fc3..b55d49e0 100644 --- a/parse.yy +++ b/parse.yy @@ -149,7 +149,7 @@ struct ForeachDimension { %union { uint64_t intVal; - float floatVal; + double floatVal; std::string *stringVal; const char *constCharPtr; @@ -326,8 +326,8 @@ primary_expression (uint64_t)yylval.intVal, @1); } | TOKEN_FLOAT_CONSTANT { - $$ = new ConstExpr(AtomicType::UniformFloat->GetAsConstType(), - (float)yylval.floatVal, @1); + $$ = new ConstExpr(AtomicType::UniformDouble->GetAsConstType(), + yylval.floatVal, @1); } | TOKEN_TRUE { $$ = new ConstExpr(AtomicType::UniformBool->GetAsConstType(), true, @1);