Function size_of_exponent (o2scl)

O2scl : Function List

size_t o2scl::size_of_exponent(double x)

Returns the number of characters required to display the exponent of x in scientific mode.

This returns 2 or 3, depending on whether or not the absolute magnitude of the exponent is greater than or equal to 100. It uses stringstream to convert the number to a string and counts the number of characters directly.