diff --git a/src/Evaluator/Evaluator.cpp b/src/Evaluator/Evaluator.cpp index d270e51..1eda38f 100644 --- a/src/Evaluator/Evaluator.cpp +++ b/src/Evaluator/Evaluator.cpp @@ -76,7 +76,7 @@ double Evaluator::EvaluateFloatExpression(BoundExpression *expression) { throw EvaluationException("Can't evaluate expression as integer, it will return an integer, not a float."); } switch (expression->GetKind()){ - case BoundExpressionKind ::LiteralFloat: return ((BoundLiteralIntegerExpression*)expression)->GetValue(); + case BoundExpressionKind ::LiteralFloat: return ((BoundLiteralFloatExpression*)expression)->GetValue(); case BoundExpressionKind ::Binary: return this -> EvaluateFloatBinary((BoundBinaryExpression*)expression); case BoundExpressionKind ::LiteralInteger: diff --git a/tests/integration/numerical_operations_tests.cpp b/tests/integration/numerical_operations_tests.cpp index 472d80f..48609c0 100644 --- a/tests/integration/numerical_operations_tests.cpp +++ b/tests/integration/numerical_operations_tests.cpp @@ -57,6 +57,6 @@ TEST_CASE( "Float Division", "[integration]" ) { REQUIRE(!script.Diagnostics -> HasErrors()); script.Evaluate(); auto lastValue = script.GetLastValue(); - REQUIRE(*any_cast(lastValue) == Approx(10.730)); + REQUIRE(*any_cast(lastValue) == Approx(10.7305524239)); } #endif