summaryrefslogtreecommitdiff
path: root/src/test-mp-equation.c
diff options
context:
space:
mode:
authormbkma <[email protected]>2020-03-05 13:06:45 +0100
committerraveit65 <[email protected]>2020-03-08 21:40:41 +0100
commitb0117b1d5ae73916c6f0d289be1f693bb5f46824 (patch)
tree4751c73751ed9951ae5a1c5b93f04c84593c6974 /src/test-mp-equation.c
parent91962719d06ce16d8bc3523872b83fae4d151e10 (diff)
downloadmate-calc-b0117b1d5ae73916c6f0d289be1f693bb5f46824.tar.bz2
mate-calc-b0117b1d5ae73916c6f0d289be1f693bb5f46824.tar.xz
Port to GNU MPFR/MPC Library
For further information please visit: https://www.mpfr.org/ http://www.multiprecision.org/mpc
Diffstat (limited to 'src/test-mp-equation.c')
-rw-r--r--src/test-mp-equation.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/test-mp-equation.c b/src/test-mp-equation.c
index 0ff3a53..ac9b000 100644
--- a/src/test-mp-equation.c
+++ b/src/test-mp-equation.c
@@ -77,7 +77,7 @@ static void
Test(char *expression, char *expected, int expected_error, int trailing_digits)
{
MPErrorCode error;
- MPNumber result;
+ MPNumber result = mp_new();
error = mp_equation_parse(expression, &options, &result, NULL);
@@ -107,6 +107,7 @@ Test(char *expression, char *expected, int expected_error, int trailing_digits)
fail("'%s' -> error %s, expected error %s", expression,
error_code_to_string(error), error_code_to_string(expected_error));
}
+ mp_clear(&result);
}
@@ -425,7 +426,7 @@ test_equations()
test("1!", "1", 0);
test("5!", "120", 0);
test("69!", "171122452428141311372468338881272839092270544893520369393648040923257279754140647424000000000000000", 0);
- test("0.1!", "", PARSER_ERR_MP);
+ test("0.1!", "0.95135077", 0);
test("−1!", "−1", 0);
test("(−1)!", "", PARSER_ERR_MP);
test("−(1!)", "−1", 0);