The "l" (ell) width spec means something in the corresponding scanf usage,
but not here. While modern POSIX says that applying "l" to "f" and other
floating format specs is a no-op, SUSv2 says it's undefined. Buildfarm
experience says that some old compilers emit warnings about it, and at
least one old stdio implementation (mingw's "ANSI" option) actually
produces wrong answers and/or crashes.
Discussion: https://postgr.es/m/21670.
1526769114@sss.pgh.pa.us
Discussion: https://postgr.es/m/
c085e1da-0d64-1c15-242d-
c921f32e0d5c@dunslane.net
if (metad->btm_version == BTREE_VERSION)
{
values[j++] = psprintf("%u", metad->btm_oldest_btpo_xact);
- values[j++] = psprintf("%lf", metad->btm_last_cleanup_num_heap_tuples);
+ values[j++] = psprintf("%f", metad->btm_last_cleanup_num_heap_tuples);
}
else
{
<para>
Here is an example using the data type <type>complex</type> from
the example in <xref linkend="xtypes"/>. The external string
- representation of that type is <literal>(%lf,%lf)</literal>,
+ representation of that type is <literal>(%f,%f)</literal>,
which is defined in the
functions <function>complex_in()</function>
and <function>complex_out()</function> functions
{
xl_btree_metadata *xlrec = (xl_btree_metadata *) rec;
- appendStringInfo(buf, "oldest_btpo_xact %u; last_cleanup_num_heap_tuples: %lf",
+ appendStringInfo(buf, "oldest_btpo_xact %u; last_cleanup_num_heap_tuples: %f",
xlrec->oldest_btpo_xact,
xlrec->last_cleanup_num_heap_tuples);
break;
printf("name sqlda descriptor: '%s' value %d\n", sqlda->sqlvar[i].sqlname, *(int *)sqlda->sqlvar[i].sqldata);
break;
case SQLFLOAT:
- printf("name sqlda descriptor: '%s' value %lf\n", sqlda->sqlvar[i].sqlname, *(double *)sqlda->sqlvar[i].sqldata);
+ printf("name sqlda descriptor: '%s' value %f\n", sqlda->sqlvar[i].sqlname, *(double *)sqlda->sqlvar[i].sqldata);
break;
case SQLDECIMAL:
{
printf("name sqlda descriptor: '%s' value %d\n", sqlda->sqlvar[i].sqlname, *(int *)sqlda->sqlvar[i].sqldata);
break;
case SQLFLOAT:
- printf("name sqlda descriptor: '%s' value %lf\n", sqlda->sqlvar[i].sqlname, *(double *)sqlda->sqlvar[i].sqldata);
+ printf("name sqlda descriptor: '%s' value %f\n", sqlda->sqlvar[i].sqlname, *(double *)sqlda->sqlvar[i].sqldata);
break;
case SQLDECIMAL:
{
get_record1();
if (sqlca.sqlcode == ECPG_NOT_FOUND)
break;
- printf("id=%d%s t='%s'%s d1=%lf%s d2=%lf%s c = '%s'%s\n",
+ printf("id=%d%s t='%s'%s d1=%f%s d2=%f%s c = '%s'%s\n",
myvar->id, mynullvar->id ? " (NULL)" : "",
myvar->t, mynullvar->t ? " (NULL)" : "",
myvar->d1, mynullvar->d1 ? " (NULL)" : "",
break;
#endif
case ECPGt_double:
- printf("name sqlda descriptor: '%s' value %lf\n", sqlda->sqlvar[i].sqlname.data, *(double *)sqlda->sqlvar[i].sqldata);
+ printf("name sqlda descriptor: '%s' value %f\n", sqlda->sqlvar[i].sqlname.data, *(double *)sqlda->sqlvar[i].sqldata);
break;
case ECPGt_numeric:
{
get_record1();
if (sqlca.sqlcode == ECPG_NOT_FOUND)
break;
- printf("id=%d%s t='%s'%s d1=%lf%s d2=%lf%s c = '%s'%s\n",
+ printf("id=%d%s t='%s'%s d1=%f%s d2=%f%s c = '%s'%s\n",
myvar->id, mynullvar->id ? " (NULL)" : "",
myvar->t, mynullvar->t ? " (NULL)" : "",
myvar->d1, mynullvar->d1 ? " (NULL)" : "",
break;
#endif
case ECPGt_double:
- printf("name sqlda descriptor: '%s' value %lf\n", sqlda->sqlvar[i].sqlname.data, *(double *)sqlda->sqlvar[i].sqldata);
+ printf("name sqlda descriptor: '%s' value %f\n", sqlda->sqlvar[i].sqlname.data, *(double *)sqlda->sqlvar[i].sqldata);
break;
case ECPGt_numeric:
{