PostGIS  3.7.0dev-r@@SVN_REVISION@@

◆ lwprint_double()

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

Definition at line 463 of file lwprint.c.

464 {
465  int length;
466  double ad = fabs(d);
467  int precision = FP_MAX(0, maxdd);
468 
469  if (ad <= OUT_MIN_DOUBLE || ad >= OUT_MAX_DOUBLE)
470  {
471  length = d2sexp_buffered_n(d, precision, buf);
472  }
473  else
474  {
475  length = d2sfixed_buffered_n(d, precision, buf);
476  }
477  buf[length] = '\0';
478 
479  return length;
480 }
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: