X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f From: Kbwms AT aol DOT com Message-ID: Date: Tue, 13 Jan 2004 15:52:28 EST Subject: Re: C99 Functions Under Development and Checkout To: djgpp-workers AT delorie DOT com MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="part1_c1.3b9ecc55.2d35b48c_boundary" X-Mailer: 8.0 for Windows sub 6021 Reply-To: djgpp-workers AT delorie DOT com --part1_c1.3b9ecc55.2d35b48c_boundary Content-Type: multipart/alternative; boundary="part1_c1.3b9ecc55.2d35b48c_alt_boundary" --part1_c1.3b9ecc55.2d35b48c_alt_boundary Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit In a message dated 1/13/2004 3:01:40 PM Eastern Standard Time, eliz AT elta DOT co DOT il writes: > Sounds okay to me, except that perhaps we should set errno to EDOM in > all these cases. > That sounds fine to me. It satisfies Posix, which I like. > Can somebody see what does glibc do in these situations? > Attached. ================================================= --part1_c1.3b9ecc55.2d35b48c_alt_boundary Content-Type: text/html; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable In a message dated 1/13/2004 3:01:40=20= PM Eastern Standard Time, eliz AT elta DOT co DOT il writes:

Sounds okay to me, except that= perhaps we should set errno to EDOM in
all these cases.


T= hat sounds fine to me.  It satisfies Posix, which I like.

Can somebody see what does glib= c do in these situations?

<= BR> Attached. 

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

--part1_c1.3b9ecc55.2d35b48c_alt_boundary-- --part1_c1.3b9ecc55.2d35b48c_boundary Content-Type: text/plain; name="s_llrintl.c" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline; filename="s_llrintl.c" /* Round argument to nearest integral value according to current rounding direction. Copyright (C) 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1997. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #include #include "math_private.h" static const long double two63[2] =3D { 9.223372036854775808000000e+18, /* 0x403E, 0x00000000, 0x00000000 */ -9.223372036854775808000000e+18 /* 0xC03E, 0x00000000, 0x00000000 */ }; long long int __llrintl (long double x) { int32_t se,j0; u_int32_t i0, i1; long long int result; volatile long double w; long double t; int sx; GET_LDOUBLE_WORDS (se, i0, i1, x); sx =3D (se >> 15) & 1; j0 =3D (se & 0x7fff) - 0x3fff; if (j0 < (int32_t) (8 * sizeof (long long int)) - 1) { if (j0 < -1) =09return 0; else if (j0 >=3D 63) =09result =3D (((long long int) i0 << 32) | i1) << (j0 - 63); else =09{ =09 w =3D two63[sx] + x; =09 t =3D w - two63[sx]; =09 GET_LDOUBLE_WORDS (se, i0, i1, t); =09 j0 =3D (se & 0x7fff) - 0x3fff; =09 if (j0 < 31) =09 result =3D i0 >> (31 - j0); =09 else =09 result =3D ((long long int) i0 << (j0 - 31)) | (i1 >> (63 - j0)); =09} } else { /* The number is too large. It is left implementation defined =09 what happens. */ return (long long int) x; } return sx ? -result : result; } weak_alias (__llrintl, llrintl) --part1_c1.3b9ecc55.2d35b48c_boundary--