PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ lwprint_double()

int lwprint_double ( double  d,
int  maxdd,
char *  buf 
)

Definition at line 457 of file lwprint.c.

458 {
459  int length;
460  double ad = fabs(d);
461  int precision = FP_MAX(0, maxdd);
462 
463  if (ad <= OUT_MIN_DOUBLE || ad >= OUT_MAX_DOUBLE)
464  {
465  length = d2sexp_buffered_n(d, precision, buf);
466  }
467  else
468  {
469  length = d2sfixed_buffered_n(d, precision, buf);
470  }
471  buf[length] = '\0';
472 
473  return length;
474 }
static uint8_t precision
Definition: cu_in_twkb.c:25
#define OUT_MAX_DOUBLE
#define FP_MAX(A, B)

References FP_MAX, OUT_MAX_DOUBLE, and precision.

Referenced by assvg_point(), BOX2D_out(), box2df_to_string(), BOX3D_out(), pointArray_svg_abs(), pointArray_svg_arc(), pointArray_svg_rel(), ptarray_to_x3d3_sb(), and stringbuffer_append_double().

Here is the caller graph for this function: