10SN/A/****************************************************************
216261Ssspitsyn
30SN/AThe author of this software is David M. Gay.
40SN/A
50SN/ACopyright (C) 1998 by Lucent Technologies
60SN/AAll Rights Reserved
72362SN/A
80SN/APermission to use, copy, modify, and distribute this software and
92362SN/Aits documentation for any purpose and without fee is hereby
100SN/Agranted, provided that the above copyright notice appear in all
110SN/Acopies and that both that the copyright notice and this
120SN/Apermission notice and warranty disclaimer appear in supporting
130SN/Adocumentation, and that the name of Lucent or any of its entities
140SN/Anot be used in advertising or publicity pertaining to
150SN/Adistribution of the software without specific, written prior
160SN/Apermission.
170SN/A
180SN/ALUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
190SN/AINCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
200SN/AIN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY
212362SN/ASPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
222362SN/AWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
232362SN/AIN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
240SN/AARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
250SN/ATHIS SOFTWARE.
260SN/A
270SN/A****************************************************************/
280SN/A
290SN/A/* Please send bug reports to David M. Gay (dmg at acm dot org,
300SN/A * with " at " changed at "@" and " dot " changed to ".").	*/
310SN/A
320SN/A#include "gdtoaimp.h"
330SN/A
340SN/A int
350SN/A#ifdef KR_headers
360SN/AstrtoId(s, sp, f0, f1) CONST char *s; char **sp; double *f0, *f1;
370SN/A#else
380SN/AstrtoId(CONST char *s, char **sp, double *f0, double *f1)
390SN/A#endif
400SN/A{
410SN/A	static FPI fpi = { 53, 1-1023-53+1, 2046-1023-53+1, 1, SI };
420SN/A	Long exp[2];
430SN/A	Bigint *B[2];
440SN/A	int k, rv[2];
450SN/A
460SN/A	B[0] = Balloc(1);
470SN/A	B[0]->wds = 2;
480SN/A	k = strtoIg(s, sp, &fpi, exp, B, rv);
490SN/A	ULtod((ULong*)f0, B[0]->x, exp[0], rv[0]);
500SN/A	Bfree(B[0]);
510SN/A	if (B[1]) {
520SN/A		ULtod((ULong*)f1, B[1]->x, exp[1], rv[1]);
530SN/A		Bfree(B[1]);
540SN/A		}
550SN/A	else {
560SN/A		((ULong*)f1)[0] = ((ULong*)f0)[0];
570SN/A		((ULong*)f1)[1] = ((ULong*)f0)[1];
580SN/A		}
590SN/A	return k;
600SN/A	}
610SN/A