X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fremainderl.c;h=a370fdaa89c4a92399a7881b74cd9fcc24190d5f;hb=7517e2fd5e24f47eed66f8390d49f807555f8770;hp=3476f948e27af4ca1e40a598cac3a0aeb1d8a98f;hpb=0e1c6ff93f27c939ba9e0df945b16ef98eaaeef1;p=gnulib.git diff --git a/lib/remainderl.c b/lib/remainderl.c index 3476f948e..a370fdaa8 100644 --- a/lib/remainderl.c +++ b/lib/remainderl.c @@ -1,5 +1,5 @@ /* Remainder. - Copyright (C) 2012 Free Software Foundation, Inc. + Copyright (C) 2012-2013 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -29,30 +29,7 @@ remainderl (long double x, long double y) #else -long double -remainderl (long double x, long double y) -{ - long double q = - roundl (x / y); - long double r = fmal (q, y, x); /* = x + q * y, computed in one step */ - /* Correct possible rounding errors in the quotient x / y. */ - long double half_y = 0.5L * y; - if (y >= 0) - { - /* Expect -y/2 <= r <= y/2. */ - if (r > half_y) - q -= 1, r = fmal (q, y, x); - else if (r < - half_y) - q += 1, r = fmal (q, y, x); - } - else - { - /* Expect y/2 <= r <= -y/2. */ - if (r > - half_y) - q += 1, r = fmal (q, y, x); - else if (r < half_y) - q -= 1, r = fmal (q, y, x); - } - return r; -} +# define USE_LONG_DOUBLE +# include "remainder.c" #endif