#include <math.h>
#include <stdio.h>
/* Tests taken from Cygnus C library. */
typedef struct
{
int line;
double value;
const char *result;
const char *format_string;
} sprint_double_type;
sprint_double_type sprint_doubles[] =
{
{__LINE__, 30.3, "< +30.3>", "<%+15.10g>"},
{__LINE__, 10.0, "<10.00>", "<%5.2f>"},
{__LINE__, 1.002121970718271e+05, "100212.19707 ", "%0-15.5f"},
{__LINE__, -1.002121970718271e+05, "-100212.19707 ", "%0-15.5f"},
{__LINE__, 1.002121970718271e+05, "000100212.19707", "%015.5f"},
{__LINE__, -1.002121970718271e+05, "-00100212.19707", "%015.5f"},
{__LINE__, 1.002121970718271e+05, "+00100212.19707", "%+015.5f"},
{__LINE__, -1.002121970718271e+05, "-00100212.19707", "%+015.5f"},
{__LINE__, 1.002121970718271e+05, " 00100212.19707", "% 015.5f"},
{__LINE__, -1.002121970718271e+05, "-00100212.19707", "% 015.5f"},
{__LINE__, 1.002121970718271e+05, "+100212.19707 ", "%+-15.5f"},
{__LINE__, -1.002121970718271e+05, "-100212.19707 ", "%+-15.5f"},
{__LINE__, -1.002121970718271e+29, "-1.0E+29", "%.1E"},
{__LINE__, -1.002126048612756e-02, "-1.002126E-02", "%+#E"},
{__LINE__, -1.002653755271637e+00, "-1.00265", "%G"},
{__LINE__, -1.003238744365917e-23, "-0.00", "%4.2f"},
{__LINE__, -1.005084840877781e-29, " -0", "%4.f"},
{__LINE__, -1.005362549674427e+01, "-10.0536", "%#g"},
{__LINE__, -1.005915042991691e-17, "-1.00592E-17", "%G"},
{__LINE__, -1.007829874228503e-18, "-1.00783e-18", "%.7g"},
{__LINE__, -1.007829874228503e-18, "-1.007830e-18", "%#.7g"},
{__LINE__, -1.009390937771849e+15, "-1009390937771848.628657", "%+f"},
{__LINE__, -1.010679382726182e-29, "-0.0000000", "%.7f"},
{__LINE__, -1.010691853346650e+13, "-10106918533466.497934", "%+f"},
{__LINE__, -1.013412912122286e-22, "-1.01E-22", "%.2E"},
{__LINE__, -1.019269582113858e-25, " -0", "%4.0f"},
{__LINE__, -1.019886033368556e+24, "-1.019886E+24", "%+.7G"},
{__LINE__, -1.021037413548719e+02, "-102.103741", "%f"},
{__LINE__, -1.023833576089065e+26, "-1.023834E+26", "%+E"},
{__LINE__, -1.024736652408627e+10, "-10247366524.086265", "%+f"},
{__LINE__, -1.025439198495476e+09, "-1.02544e+09", "%+g"},
{__LINE__, -1.027080247585776e-04, "-0.0001027", "%6.7f"},
{__LINE__, -1.028096307262016e+18, "-1.0281E+18", "%3G"},
{__LINE__, -1.029604290697901e-02, "-0.010296", "%g"},
{__LINE__, -1.034347730570491e+16, "-10343477305704908.975059", "%+f"},
{__LINE__, -1.034663325049286e+22, "-1.0E+22", "%#.1E"},
{__LINE__, -1.034843152721857e-14, " -0", "%6.f"},
{__LINE__, -1.036082122299529e-29, "-1.04e-29", "%4.3g"},
{__LINE__, -1.037213662365954e-09, "-1e-09", "%3.e"},
{__LINE__, -1.038563976775690e-12, "-0.000000", "%f"},
{__LINE__, -1.040910158681323e-02, "-0.0104091", "%+G"},
{__LINE__, -1.044680094714482e-20, "-1.04468E-20", "%G"},
{__LINE__, -1.044990054091126e+24, "-1.044990E+24", "%+E"},
{__LINE__, -1.045693871096982e+11, "-1.045694e+11", "%+e"},
{__LINE__, -1.045714133591312e-04, "-0.000104571", "%+#3g"},
{__LINE__, -1.046215079103016e-15, "-1.04622e-15", "%g"},
{__LINE__, -1.046285293993789e-18, "-1.04629E-18", "%+4G"},
{__LINE__, -1.046306092899333e-06, "-0.00", "%0.2f"},
{__LINE__, -1.047308973649206e-22, "-1.05E-22", "%+1.3G"},
{__LINE__, -1.047369032507755e+01, "-1.047369E+01", "%E"},
{__LINE__, -1.048986365562919e-21, "-1.05E-21", "%+.2E"},
{__LINE__, -1.049530193156793e-17, "-1.04953E-17", "%+G"},
{__LINE__, -1.050073419263768e+25, "-1.05007e+25", "%g"},
{__LINE__, -1.051739652002504e-28, "-0.000000", "%+f"},
{__LINE__, -1.054493420082636e+21, "-1.0545e+21", "%#5.4e"},
{__LINE__, -1.055867291029098e+18, "-1.05587e+18", "%g"},
{__LINE__, -1.056514389757866e-16, "-1.05651E-16", "%5.6G"},
{__LINE__, -1.057180924868704e+15, "-1057180924868704", "%4.f"},
{__LINE__, -1.058455468395683e-23, "-1.05846e-23", "%g"},
{__LINE__, -1.062560982393212e+08, "-1.06256e+08", "%g"},
{__LINE__, -1.063365829241138e-10, "-1.063366e-10", "%+e"},
{__LINE__, -1.063568908667280e-19, "-1.06357E-19", "%+G"},
{__LINE__, -1.063734263253492e-13, "-0.000000", "%0f"},
{__LINE__, -1.064472689765495e-13, "-1E-13", "%4.0G"},
{__LINE__, -1.067192610000129e-25, "-1.06719E-25", "%G"},
{__LINE__, -1.068401334996592e-12, "-0.0000000", "%+.7f"},
{__LINE__, -1.069012628653724e-13, "-1.069013E-13", "%+.7G"},
{__LINE__, -1.069451976810790e+16, "-10694519768107904.056365", "%f"},
{__LINE__, -1.069568935323556e+17, "-1.06957e+17", "%g"},
{__LINE__, -1.071351044854107e-29, "-1.07135e-29", "%g"},
{__LINE__, -1.072274197526185e-21, "-1E-21", "%1.G"},
{__LINE__, -1.073875921752995e+23, "-1E+23", "%5.E"},
{__LINE__, -1.074835151152265e-12, "-1.0748e-12", "%1.5g"},
{__LINE__, -1.075171047088241e-19, "-1.07517E-19", "%#G"},
{__LINE__, -1.076258826412760e+22, "-1.076259e+22", "%+e"},
{__LINE__, -1.076365103160401e+06, "-1.07637E+06", "%+4.6G"},
{__LINE__, -1.076817750454633e+08, "-1e+08", "%4.g"},
{__LINE__, -1.078615405755685e-30, "-1e-30", "%4.g"},
{__LINE__, -1.078629622917468e-25, "-1.078630e-25", "%e"},
{__LINE__, -1.079352432833170e+11, "-107935243283", "%+2.f"},
{__LINE__, -1.081431147440215e+16, "-10814311474402147.439378", "%+f"},
{__LINE__, -1.083042116905339e-16, "-1.083e-16", "%.5g"},
{__LINE__, -1.085351710708553e-10, "-1.085e-10", "%1.4g"},
{__LINE__, -1.085796045618276e+07, "-1.085796e+07", "%e"},
{__LINE__, -1.087398259981007e+22, "-1.0874e+22", "%g"},
{__LINE__, -1.087986044402224e-11, "-1.087986e-11", "%e"},
{__LINE__, -1.090451848762709e-02, "-1.090452e-02", "%e"},
{__LINE__, -1.091463236899737e+11, "-1.091463E+11", "%#E"},
{__LINE__, -1.091617921737384e-29, "-1.09162e-29", "%3g"},
{__LINE__, -1.092049328579047e-17, "-1.092049E-17", "%E"},
{__LINE__, -1.093647615472090e+06, "-1093647.61547", "%6.5f"},
{__LINE__, -1.094133175602384e-08, "-1.1E-08", "%0.1E"},
{__LINE__, -1.095397916728214e-23, "-1e-23", "%6.e"},
{__LINE__, -1.098958790437321e+02, "-109.895879", "%+#f"},
{__LINE__, -1.100194638181594e-20, "-1.100195e-20", "%e"},
{__LINE__, -1.102174253534260e+05, "-1.1e+05", "%2.3g"},
{__LINE__, -1.102890180316350e-12, "-1.10289e-12", "%+g"},
{__LINE__, -1.105582337418378e+00, "-1.11", "%3.3g"},
{__LINE__, -1.110515122647056e+04, "-1.E+04", "%#0.G"},
{__LINE__, -1.111365895262625e-18, "-1e-18", "%0.g"},
{__LINE__, -1.112010622677495e+04, "-11120.1", "%g"},
{__LINE__, -1.112580043156699e-23, "-1.11258e-23", "%1g"},
{__LINE__, -1.112829057091303e+08, "-1.11283e+08", "%+2g"},
{__LINE__, -1.115019046200472e+18, "-1.1150190e+18", "%+#.7e"},
{__LINE__, -1.118078332268016e-13, "-1.12E-13", "%1.3G"},
{__LINE__, -1.119113571963886e+08, "-1.119114e+08", "%e"},
{__LINE__, -1.120102397563448e-15, "-1.12e-15", "%.4g"},
{__LINE__, -1.120707480791434e-19, "-1.12071e-19", "%g"},
{__LINE__, -1.124243676139007e-07, "-0.000000", "%f"},
{__LINE__, -1.125025214608798e+15, "-1.12503E+15", "%0G"},
{__LINE__, -1.126074395136447e+06, "-1E+06", "%+.0G"},
{__LINE__, -1.127203019940870e-06, "-0.000001", "%+#7f"},
{__LINE__, -1.130577648480677e+01, "-1.130578e+01", "%e"},
{__LINE__, -1.131469694425240e-11, "-1.13147e-11", "%#0.6g"},
{__LINE__, -1.132225023239752e+02, "-113.223", "%G"},
{__LINE__, -1.133702113050128e+20, "-1E+20", "%+3.E"},
{__LINE__, -1.135529466224404e-13, "-1.13553e-13", "%#g"},
{__LINE__, -1.137587210063004e+21, "-1e+21", "%.1g"},
{__LINE__, -1.140765637106361e-21, "-1.1e-21", "%+.1e"},
{__LINE__, -1.141182595083699e-18, "-0.000000", "%f"},
{__LINE__, -1.141695709120972e+00, "-1.1417", "%3G"},
{__LINE__, -1.143199141708028e+18, "-1143199141708027833", "%2.f"},
{__LINE__, -1.146712902056139e+21, "-1146712902056139071760.298975", "%f"},
{__LINE__, -1.146837903839073e-02, " -0.0", "%+5.1f"},
{__LINE__, -1.147363016107446e+10, "-1.14736e+10", "%+7g"},
{__LINE__, -1.149575523465052e+20, "-114957552346505220697.28140", "%+.5f"},
{__LINE__, -1.1527489553925