annotate libquadmath/math/ldexpq.c @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 1830386684a0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
1 /* @(#)s_ldexp.c 5.1 93/09/24 */
68
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 /*
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 * ====================================================
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 *
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 * Developed at SunPro, a Sun Microsystems, Inc. business.
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 * Permission to use, copy, modify, and distribute this
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 * software is freely granted, provided that this notice
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 * is preserved.
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 * ====================================================
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 */
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
12
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
13 #if defined(LIBM_SCCS) && !defined(lint)
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
14 static char rcsid[] = "$NetBSD: s_ldexp.c,v 1.6 1995/05/10 20:47:40 jtc Exp $";
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
15 #endif
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
16
68
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 #include "quadmath-imp.h"
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
18
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 __float128
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 ldexpq (__float128 value, int exp)
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 {
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
22 if(!finiteq(value)||value==0) return value + value;
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
23 value = scalbnq(value,exp);
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
24 if(!finiteq(value)||value==0) errno = ERANGE;
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
25 return value;
68
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
26 }
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
27
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
28
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
29
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
30
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
31
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
32 /* Note, versioning issues are punted to ldbl-opt in this case. */