79788628

Date: 2025-10-12 15:07:32
Score: 1
Natty:
Report link

Simple solution for programmer, but not optimal for CPU time:

size_t sigfigs(double x)
{
    return std::to_string(x).size();//create r-value string and get its size!
}

But you must take into account presence of "-" sign, dot, exponent, their sign and all possible combinations. I think, its impossible to create universal sigfigs() function, only problem specific.

Reasons:
  • Has code block (-0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: user31674439