This enum give upper bounds on the maximum string lengths storing each scalar numerical type, and the starting value for long double that can get way too long for stack storage when printed. It is safe to use stack‐allocated buffers of these sizes for generating decimal representations of the corresponding type, including sign and terminating null character, using the default precision of 6 significant digits for floating point types.

Synopsis

Declared in <bslstl_string.h>

enum MaxDecimalStringLengths;

Members

Name

Description

e_MAX_SHORT_STRLEN10

Maximum decimal string length for a short, including sign and null.

e_MAX_INT_STRLEN10

Maximum decimal string length for an int, including sign and null.

e_MAX_INT64_STRLEN10

Maximum decimal string length for an int, including sign and null.

e_MAX_FLOAT_STRLEN10

Maximum string length for a float in base‐10, including sign and null terminator.

e_MAX_DOUBLE_STRLEN10

Maximum string length for a float in base‐10, including sign and null terminator.

e_MAX_LONGDOUBLE_STRLEN10

Maximum string length for a float in base‐10, including sign and null terminator.

e_MAX_SCALAR_STRLEN10

Maximum string length for a float in base‐10, including sign and null terminator.

e_STARTING_LONGDOUBLE_STRLEN10

Maximum string length for a float in base‐10, including sign and null terminator.

Created with MrDocs