Projects
home:pandora:RobinOS23
mpfr
_service:download_src_package:0007-jn-interm-ze...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:download_src_package:0007-jn-interm-zero.patch of Package mpfr
diff -Naurd mpfr-4.1.0-a/PATCHES mpfr-4.1.0-b/PATCHES --- mpfr-4.1.0-a/PATCHES 2021-02-11 12:53:38.382850990 +0000 +++ mpfr-4.1.0-b/PATCHES 2021-02-11 12:53:38.426850512 +0000 @@ -0,0 +1 @@ +jn-interm-zero diff -Naurd mpfr-4.1.0-a/VERSION mpfr-4.1.0-b/VERSION --- mpfr-4.1.0-a/VERSION 2021-02-11 12:52:52.563350183 +0000 +++ mpfr-4.1.0-b/VERSION 2021-02-11 12:53:38.426850512 +0000 @@ -1 +1 @@ -4.1.0-p6 +4.1.0-p7 diff -Naurd mpfr-4.1.0-a/src/jyn_asympt.c mpfr-4.1.0-b/src/jyn_asympt.c --- mpfr-4.1.0-a/src/jyn_asympt.c 2020-07-10 10:33:32.000000000 +0000 +++ mpfr-4.1.0-b/src/jyn_asympt.c 2021-02-11 12:53:38.410850685 +0000 @@ -69,6 +69,8 @@ MPFR_ZIV_INIT (loop, w); for (;;) { + int ok = 1; + mpfr_set_prec (c, w); mpfr_init2 (s, w); mpfr_init2 (P, w); @@ -92,6 +94,13 @@ /* now s approximates sin(z)+cos(z), and c approximates sin(z)-cos(z), with total absolute error bounded by 2^(1-w). */ + /* if s or c is zero, MPFR_GET_EXP will fail below */ + if (MPFR_IS_ZERO(s) || MPFR_IS_ZERO(c)) + { + ok = 0; + goto clear; + } + /* precompute 1/(8|z|) */ mpfr_si_div (iz, MPFR_IS_POS(z) ? 1 : -1, z, MPFR_RNDN); /* err <= 1 */ mpfr_div_2ui (iz, iz, 3, MPFR_RNDN); @@ -257,6 +266,9 @@ err = (err >= err2) ? err + 1 : err2 + 1; /* the absolute error on c is bounded by 2^(err - w) */ + err -= MPFR_GET_EXP (c); + + clear: mpfr_clear (s); mpfr_clear (P); mpfr_clear (Q); @@ -266,8 +278,7 @@ mpfr_clear (err_s); mpfr_clear (err_u); - err -= MPFR_GET_EXP (c); - if (MPFR_LIKELY (MPFR_CAN_ROUND (c, w - err, MPFR_PREC(res), r))) + if (ok && MPFR_LIKELY (MPFR_CAN_ROUND (c, w - err, MPFR_PREC(res), r))) break; if (diverge != 0) { diff -Naurd mpfr-4.1.0-a/src/mpfr.h mpfr-4.1.0-b/src/mpfr.h --- mpfr-4.1.0-a/src/mpfr.h 2021-02-11 12:52:52.559350226 +0000 +++ mpfr-4.1.0-b/src/mpfr.h 2021-02-11 12:53:38.422850555 +0000 @@ -27,7 +27,7 @@ #define MPFR_VERSION_MAJOR 4 #define MPFR_VERSION_MINOR 1 #define MPFR_VERSION_PATCHLEVEL 0 -#define MPFR_VERSION_STRING "4.1.0-p6" +#define MPFR_VERSION_STRING "4.1.0-p7" /* User macros: MPFR_USE_FILE: Define it to make MPFR define functions dealing diff -Naurd mpfr-4.1.0-a/src/version.c mpfr-4.1.0-b/src/version.c --- mpfr-4.1.0-a/src/version.c 2021-02-11 12:52:52.559350226 +0000 +++ mpfr-4.1.0-b/src/version.c 2021-02-11 12:53:38.426850512 +0000 @@ -25,5 +25,5 @@ const char * mpfr_get_version (void) { - return "4.1.0-p6"; + return "4.1.0-p7"; } diff -Naurd mpfr-4.1.0-a/tests/tj0.c mpfr-4.1.0-b/tests/tj0.c --- mpfr-4.1.0-a/tests/tj0.c 2020-01-08 18:11:13.000000000 +0000 +++ mpfr-4.1.0-b/tests/tj0.c 2021-02-11 12:53:38.410850685 +0000 @@ -27,6 +27,25 @@ #define REDUCE_EMAX 262143 /* otherwise arg. reduction is too expensive */ #include "tgeneric.c" +/* bug found in revision 14399 with GMP_CHECK_RANDOMIZE=1612721106588971 */ +static void +bug20210208 (void) +{ + mpfr_t x, y; + int inex; + + mpfr_init2 (x, 79); + mpfr_init2 (y, 1); + mpfr_set_str (x, "2.552495117262005805960565e+02", 10, MPFR_RNDN); + mpfr_clear_flags (); + inex = mpfr_j0 (y, x, MPFR_RNDZ); + MPFR_ASSERTN (mpfr_cmp_si_2exp (y, -1, -5) == 0); + MPFR_ASSERTN (inex > 0); + MPFR_ASSERTN (__gmpfr_flags == MPFR_FLAGS_INEXACT); + mpfr_clear (x); + mpfr_clear (y); +} + int main (int argc, char *argv[]) { @@ -35,6 +54,8 @@ tests_start_mpfr (); + bug20210208 (); + mpfr_init (x); mpfr_init (y);
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2