From 52bb535ff77285646af89faa5d7c9f893b8a909f Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 14 Feb 2014 12:53:48 +0100 Subject: [PATCH] demo: test both mp_n_root() implementations --- demo/demo.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/demo/demo.c b/demo/demo.c index 37dba51..78e0903 100644 --- a/demo/demo.c +++ b/demo/demo.c @@ -179,8 +179,13 @@ printf("compare no compare!\n"); return EXIT_FAILURE; } printf("\nmp_sqrt() error!"); return EXIT_FAILURE; } - mp_n_root(&a, 2, &a); - if (mp_cmp_mag(&b, &a) != MP_EQ) { + mp_n_root_ex(&a, 2, &c, 0); + mp_n_root_ex(&a, 2, &d, 1); + if (mp_cmp_mag(&c, &d) != MP_EQ) { + printf("\nmp_n_root_ex() bad result!"); + return EXIT_FAILURE; + } + if (mp_cmp_mag(&b, &c) != MP_EQ) { printf("mp_sqrt() bad result!\n"); return 1; }