diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2020-01-19 23:36:31 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2020-01-19 23:36:31 +0000 |
commit | 1d4eda0d2362c7404a81bb0e1e308565b8a4b8f9 (patch) | |
tree | da5a6b2829fa072fe1ae806b45f6b5cc70a3e313 /Build/source/libs/gmp/gmp-src/mpq/div.c | |
parent | d2777035be2644c9649530be7f9fa31c8abaaf63 (diff) |
gmp-6.2.0
git-svn-id: svn://tug.org/texlive/trunk@53461 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/gmp/gmp-src/mpq/div.c')
-rw-r--r-- | Build/source/libs/gmp/gmp-src/mpq/div.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/Build/source/libs/gmp/gmp-src/mpq/div.c b/Build/source/libs/gmp/gmp-src/mpq/div.c index 3a6018a2268..3bd97264d19 100644 --- a/Build/source/libs/gmp/gmp-src/mpq/div.c +++ b/Build/source/libs/gmp/gmp-src/mpq/div.c @@ -1,6 +1,7 @@ /* mpq_div -- divide two rational numbers. -Copyright 1991, 1994-1996, 2000, 2001, 2015 Free Software Foundation, Inc. +Copyright 1991, 1994-1996, 2000, 2001, 2015, 2018 Free Software +Foundation, Inc. This file is part of the GNU MP Library. @@ -28,7 +29,6 @@ You should have received copies of the GNU General Public License and the GNU Lesser General Public License along with the GNU MP Library. If not, see https://www.gnu.org/licenses/. */ -#include "gmp.h" #include "gmp-impl.h" @@ -49,12 +49,9 @@ mpq_div (mpq_ptr quot, mpq_srcptr op1, mpq_srcptr op2) if (UNLIKELY (quot == op2)) { - if (op1 == op2) + if (UNLIKELY (op1 == op2)) { - PTR(NUM(quot))[0] = 1; - SIZ(NUM(quot)) = 1; - PTR(DEN(quot))[0] = 1; - SIZ(DEN(quot)) = 1; + mpq_set_ui (quot, 1, 1); return; } @@ -83,7 +80,7 @@ mpq_div (mpq_ptr quot, mpq_srcptr op1, mpq_srcptr op2) /* We special case this to simplify allocation logic; gcd(0,x) = x is a singular case for the allocations. */ SIZ(NUM(quot)) = 0; - PTR(DEN(quot))[0] = 1; + MPZ_NEWALLOC (DEN(quot), 1)[0] = 1; SIZ(DEN(quot)) = 1; return; } |