|
| 1 | +/*============================================================================ |
| 2 | +
|
| 3 | + This file is part of FLINT. |
| 4 | +
|
| 5 | + FLINT is free software; you can redistribute it and/or modify |
| 6 | + it under the terms of the GNU General Public License as published by |
| 7 | + the Free Software Foundation; either version 2 of the License, or |
| 8 | + (at your option) any later version. |
| 9 | +
|
| 10 | + FLINT is distributed in the hope that it will be useful, |
| 11 | + but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | + GNU General Public License for more details. |
| 14 | +
|
| 15 | + You should have received a copy of the GNU General Public License |
| 16 | + along with FLINT; if not, write to the Free Software |
| 17 | + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 18 | +
|
| 19 | +===============================================================================*/ |
| 20 | +/**************************************************************************** |
| 21 | +
|
| 22 | + Copyright (C) 2010 William Hart |
| 23 | +
|
| 24 | +*****************************************************************************/ |
| 25 | + |
| 26 | +#include <stdio.h> |
| 27 | +#include <stdlib.h> |
| 28 | +#include <mpir.h> |
| 29 | +#include <mpfr.h> |
| 30 | +#include "flint.h" |
| 31 | +#include "mpfr_vec.h" |
| 32 | +#include "ulong_extras.h" |
| 33 | + |
| 34 | +int main(void) |
| 35 | +{ |
| 36 | + int result; |
| 37 | + printf("init/clear...."); |
| 38 | + fflush(stdout); |
| 39 | + |
| 40 | + for (ulong i = 0; i < 10000UL; i++) |
| 41 | + { |
| 42 | + __mpfr_struct * a; |
| 43 | + ulong j; |
| 44 | + |
| 45 | + ulong length = n_randint(100); |
| 46 | + ulong prec = n_randint(200) + MPFR_PREC_MIN; |
| 47 | + |
| 48 | + a = _mpfr_vec_init(length, prec); |
| 49 | + |
| 50 | + for (j = 0; j < length; j++) |
| 51 | + mpfr_set_ui(a + j, 0, GMP_RNDN); |
| 52 | + |
| 53 | + _mpfr_vec_clear(a, length); |
| 54 | + } |
| 55 | + |
| 56 | + printf("PASS\n"); |
| 57 | + return 0; |
| 58 | +} |
0 commit comments