The function is overloaded. Both overloads return the precision that was set before the call to the function. cout.precision()
may be what you want to query it.
To save it and set it back later:
auto old_precision = cout.precision(temp_precision);
// do stuff
cout.precision(old_precision);