strtopd.c revision 1.1
11.1Skleink/* $NetBSD: strtopd.c,v 1.1 2006/01/25 15:18:53 kleink Exp $ */ 21.1Skleink 31.1Skleink/**************************************************************** 41.1Skleink 51.1SkleinkThe author of this software is David M. Gay. 61.1Skleink 71.1SkleinkCopyright (C) 1998 by Lucent Technologies 81.1SkleinkAll Rights Reserved 91.1Skleink 101.1SkleinkPermission to use, copy, modify, and distribute this software and 111.1Skleinkits documentation for any purpose and without fee is hereby 121.1Skleinkgranted, provided that the above copyright notice appear in all 131.1Skleinkcopies and that both that the copyright notice and this 141.1Skleinkpermission notice and warranty disclaimer appear in supporting 151.1Skleinkdocumentation, and that the name of Lucent or any of its entities 161.1Skleinknot be used in advertising or publicity pertaining to 171.1Skleinkdistribution of the software without specific, written prior 181.1Skleinkpermission. 191.1Skleink 201.1SkleinkLUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 211.1SkleinkINCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. 221.1SkleinkIN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY 231.1SkleinkSPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 241.1SkleinkWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER 251.1SkleinkIN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, 261.1SkleinkARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF 271.1SkleinkTHIS SOFTWARE. 281.1Skleink 291.1Skleink****************************************************************/ 301.1Skleink 311.1Skleink/* Please send bug reports to David M. Gay (dmg at acm dot org, 321.1Skleink * with " at " changed at "@" and " dot " changed to "."). */ 331.1Skleink 341.1Skleink#include "gdtoaimp.h" 351.1Skleink 361.1Skleink int 371.1Skleink#ifdef KR_headers 381.1Skleinkstrtopd(s, sp, d) char *s; char **sp; double *d; 391.1Skleink#else 401.1Skleinkstrtopd(CONST char *s, char **sp, double *d) 411.1Skleink#endif 421.1Skleink{ 431.1Skleink static FPI fpi0 = { 53, 1-1023-53+1, 2046-1023-53+1, 1, SI }; 441.1Skleink ULong bits[2]; 451.1Skleink Long exp; 461.1Skleink int k; 471.1Skleink 481.1Skleink k = strtodg(s, sp, &fpi0, &exp, bits); 491.1Skleink ULtod((ULong*)d, bits, exp, k); 501.1Skleink return k; 511.1Skleink } 52