G
Gianni Mariani
I need to write float values in a specific format.
#include <iostream>
#include <iomanip>
void outdbl( double d )
{
std::cout
<< std::setiosflags(
std::ios_base::showpoint | std::ios_base::right
)
<< std::setprecision(16)
<< d
<< "\n";
}
int main()
{
outdbl( 22.0 );
outdbl( 1.111111111111111111111111 );
}
------------
I would like to see the output be:
22.0
1.111111111111111? ... + whatever the roundoff gives as the last digit
I can't seem to find the incantation if iosflags that that does this.
#include <iostream>
#include <iomanip>
void outdbl( double d )
{
std::cout
<< std::setiosflags(
std::ios_base::showpoint | std::ios_base::right
)
<< std::setprecision(16)
<< d
<< "\n";
}
int main()
{
outdbl( 22.0 );
outdbl( 1.111111111111111111111111 );
}
------------
I would like to see the output be:
22.0
1.111111111111111? ... + whatever the roundoff gives as the last digit
I can't seem to find the incantation if iosflags that that does this.