Deleted Added
full compact
strtopQ.c (112158) strtopQ.c (165743)
1/****************************************************************
2
3The author of this software is David M. Gay.
4
5Copyright (C) 1998, 2000 by Lucent Technologies
6All Rights Reserved
7
8Permission to use, copy, modify, and distribute this software and

--- 12 unchanged lines hidden (view full) ---

21SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
22WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
23IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
24ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
25THIS SOFTWARE.
26
27****************************************************************/
28
1/****************************************************************
2
3The author of this software is David M. Gay.
4
5Copyright (C) 1998, 2000 by Lucent Technologies
6All Rights Reserved
7
8Permission to use, copy, modify, and distribute this software and

--- 12 unchanged lines hidden (view full) ---

21SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
22WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
23IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
24ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
25THIS SOFTWARE.
26
27****************************************************************/
28
29/* Please send bug reports to
30 David M. Gay
31 Bell Laboratories, Room 2C-463
32 600 Mountain Avenue
33 Murray Hill, NJ 07974-0636
34 U.S.A.
35 dmg@bell-labs.com
36 */
29/* Please send bug reports to David M. Gay (dmg at acm dot org,
30 * with " at " changed at "@" and " dot " changed to "."). */
37
38#include "gdtoaimp.h"
39
40#undef _0
41#undef _1
42
43/* one or the other of IEEE_MC68k or IEEE_8087 should be #defined */
44

--- 12 unchanged lines hidden (view full) ---

57
58 int
59#ifdef KR_headers
60strtopQ(s, sp, V) CONST char *s; char **sp; void *V;
61#else
62strtopQ(CONST char *s, char **sp, void *V)
63#endif
64{
31
32#include "gdtoaimp.h"
33
34#undef _0
35#undef _1
36
37/* one or the other of IEEE_MC68k or IEEE_8087 should be #defined */
38

--- 12 unchanged lines hidden (view full) ---

51
52 int
53#ifdef KR_headers
54strtopQ(s, sp, V) CONST char *s; char **sp; void *V;
55#else
56strtopQ(CONST char *s, char **sp, void *V)
57#endif
58{
65#ifdef Sudden_Underflow
66 static FPI fpi = { 113, 1-16383-113+1, 32766 - 16383 - 113 + 1, 1, 1 };
67#else
68 static FPI fpi = { 113, 1-16383-113+1, 32766 - 16383 - 113 + 1, 1, 0 };
69#endif
59 static FPI fpi = { 113, 1-16383-113+1, 32766 - 16383 - 113 + 1, 1, SI };
70 ULong bits[4];
71 Long exp;
72 int k;
73 ULong *L = (ULong*)V;
74
75 k = strtodg(s, sp, &fpi, &exp, bits);
76 switch(k & STRTOG_Retmask) {
77 case STRTOG_NoNumber:

--- 17 unchanged lines hidden (view full) ---

95 break;
96
97 case STRTOG_Infinite:
98 L[_0] = 0x7fff0000;
99 L[_1] = L[_2] = L[_3] = 0;
100 break;
101
102 case STRTOG_NaN:
60 ULong bits[4];
61 Long exp;
62 int k;
63 ULong *L = (ULong*)V;
64
65 k = strtodg(s, sp, &fpi, &exp, bits);
66 switch(k & STRTOG_Retmask) {
67 case STRTOG_NoNumber:

--- 17 unchanged lines hidden (view full) ---

85 break;
86
87 case STRTOG_Infinite:
88 L[_0] = 0x7fff0000;
89 L[_1] = L[_2] = L[_3] = 0;
90 break;
91
92 case STRTOG_NaN:
103 L[_0] = 0x7fffffff;
104 L[_1] = L[_2] = L[_3] = (ULong)-1;
93 L[0] = ld_QNAN0;
94 L[1] = ld_QNAN1;
95 L[2] = ld_QNAN2;
96 L[3] = ld_QNAN3;
105 }
106 if (k & STRTOG_Neg)
107 L[_0] |= 0x80000000L;
108 return k;
109 }
97 }
98 if (k & STRTOG_Neg)
99 L[_0] |= 0x80000000L;
100 return k;
101 }