Add representation mode

This commit is contained in:
Louis RUBET 2014-09-04 17:26:38 +02:00
parent 3bbc53a9ef
commit 1fd3c57898

21
src/rpn-mode.h Normal file
View file

@ -0,0 +1,21 @@
void std()
{
cout << setprecision(FLOATING_DEFAULT_PRECISION);
cout.unsetf(ios_base::floatfield);
}
void fix()
{
MIN_ARGUMENTS(1);
ARG_IS_OF_TYPE(0, cmd_number);
cout << setprecision((int)getf()) << fixed;
}
void sci()
{
MIN_ARGUMENTS(1);
ARG_IS_OF_TYPE(0, cmd_number);
cout << setprecision((int)getf()) << scientific;
}