1233545Sjchandra/**************************************************************** 2233545Sjchandra 3233545SjchandraThe author of this software is David M. Gay. 4233545Sjchandra 5233545SjchandraCopyright (C) 1998 by Lucent Technologies 6233545SjchandraAll Rights Reserved 7233545Sjchandra 8233545SjchandraPermission to use, copy, modify, and distribute this software and 9233545Sjchandraits documentation for any purpose and without fee is hereby 10233545Sjchandragranted, provided that the above copyright notice appear in all 11233545Sjchandracopies and that both that the copyright notice and this 12233545Sjchandrapermission notice and warranty disclaimer appear in supporting 13233545Sjchandradocumentation, and that the name of Lucent or any of its entities 14233545Sjchandranot be used in advertising or publicity pertaining to 15233545Sjchandradistribution of the software without specific, written prior 16233545Sjchandrapermission. 17233545Sjchandra 18233545SjchandraLUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 19233545SjchandraINCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. 20233545SjchandraIN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY 21233545SjchandraSPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 22233545SjchandraWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER 23233545SjchandraIN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, 24233545SjchandraARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF 25233545SjchandraTHIS SOFTWARE. 26233545Sjchandra 27233545Sjchandra****************************************************************/ 28233545Sjchandra 29233545Sjchandra/* Please send bug reports to David M. Gay (dmg at acm dot org, 30233545Sjchandra * with " at " changed at "@" and " dot " changed to "."). */ 31233545Sjchandra 32233545Sjchandra#include "gdtoaimp.h" 33233545Sjchandra 34233545Sjchandra int 35233545Sjchandra#ifdef KR_headers 36233545SjchandrastrtoIf(s, sp, f0, f1) CONST char *s; char **sp; float *f0, *f1; 37233545Sjchandra#else 38233545SjchandrastrtoIf(CONST char *s, char **sp, float *f0, float *f1) 39233545Sjchandra#endif 40233545Sjchandra{ 41233545Sjchandra static FPI fpi = { 24, 1-127-24+1, 254-127-24+1, 1, SI }; 42233545Sjchandra Long exp[2]; 43233545Sjchandra Bigint *B[2]; 44233545Sjchandra int k, rv[2]; 45233545Sjchandra 46233545Sjchandra B[0] = Balloc(0); 47233545Sjchandra B[0]->wds = 1; 48233545Sjchandra k = strtoIg(s, sp, &fpi, exp, B, rv); 49233545Sjchandra ULtof((ULong*)f0, B[0]->x, exp[0], rv[0]); 50233545Sjchandra Bfree(B[0]); 51233545Sjchandra if (B[1]) { 52233545Sjchandra ULtof((ULong*)f1, B[1]->x, exp[1], rv[1]); 53233545Sjchandra Bfree(B[1]); 54233545Sjchandra } 55233545Sjchandra else 56233545Sjchandra *(ULong*)f1 = *(ULong*)f0; 57233545Sjchandra return k; 58233545Sjchandra } 59233545Sjchandra