mirror of
https://github.com/louisrubet/rpn
synced 2025-01-01 18:20:06 +01:00
Add representation mode
This commit is contained in:
parent
3bbc53a9ef
commit
1fd3c57898
1 changed files with 21 additions and 0 deletions
21
src/rpn-mode.h
Normal file
21
src/rpn-mode.h
Normal 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;
|
||||
}
|
Loading…
Reference in a new issue