The R Project SVN R

Rev

Rev 77921 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 77921 Rev 78364
Line 96... Line 96...
96
	  int *iexp, int *minexp, int *maxexp,
96
	  int *iexp, int *minexp, int *maxexp,
97
	  DTYPE *eps, DTYPE *epsneg, DTYPE *xmin, DTYPE *xmax)
97
	  DTYPE *eps, DTYPE *epsneg, DTYPE *xmin, DTYPE *xmax)
98
{
98
{
99
	volatile DTYPE a, b, beta, betain, betah, one,
99
	volatile DTYPE a, b, beta, betain, betah, one,
100
		t, temp, tempa, temp1, two, y, z, zero;
100
		t, temp, tempa, temp1, two, y, z, zero;
101
	int i, itemp, iz, j, k, mx, nxres;
101
	int i, iz, j, k, mx, nxres;
102
 
102
 
103
	one = 1;
103
	one = 1;
104
	two = one+one;
104
	two = one+one;
105
	zero = one-one;
105
	zero = one-one;
106
 
106
 
107
		/* determine ibeta, beta ala malcolm. */
107
		/* determine ibeta, beta ala malcolm. */
108
 
-
 
109
	a = one;
108
	a = one; // a = <large> = 9.0072e+15 for 'double' is used later
110
	do {
109
	do {
111
		a = a + a;
110
		a = a + a;
112
		temp = a + one;
111
		temp = a + one;
113
		temp1 = temp - a;
112
		temp1 = temp - a;
114
	}
113
	}
115
	while(temp1 - one == zero);
114
	while(temp1 - one == zero);
-
 
115
#ifdef _no_longer___did_overflow_ // on IBM PowerPPC ('Power 8')
-
 
116
	int itemp;
116
	b = one;
117
	b = one;
117
	do {
118
	do {
118
		b = b + b;
119
		b = b + b;
119
		temp = a + b;
120
		temp = a + b;
120
		itemp = (int)(temp - a);
121
		itemp = (int)(temp - a);
121
	}
122
	}
122
	while (itemp == 0);
123
	while (itemp == 0);
123
	*ibeta = itemp;
124
	*ibeta = itemp;
-
 
125
#else
-
 
126
	*ibeta = (int) FLT_RADIX;
-
 
127
#endif
124
	beta = *ibeta;
128
	beta = *ibeta;
125
 
129
 
126
		/* determine it, irnd */
130
		/* determine it, irnd */
127
 
131
 
128
	*it = 0;
132
	*it = 0;