feat: add input_number function

This commit is contained in:
Matthieu Bessat 2022-05-16 08:29:14 +02:00
parent bcaf2cb3b7
commit d562af9876
8 changed files with 61 additions and 11 deletions

View file

@ -68,6 +68,10 @@ void test_evaluation()
evaluate(state, "(cos(2)^2)+(sin(2)^2)", &resVal, &resType);
assert(resType == TYPE_FLOAT);
assert(float_almost_equal(1, get_float_from_int_rep(resVal)));
evaluate(state, "get_pi()", &resVal, &resType);
assert(resType == TYPE_FLOAT);
assert(float_almost_equal(3.14159, get_float_from_int_rep(resVal)));
evaluate(state, "random_int(1, 100)", &resVal, &resType);
assert(resType == TYPE_INT);