#64: removed useless members

This commit is contained in:
RUBET Louis 2017-05-23 14:34:11 +02:00
parent 669fd212c8
commit 5b921811a9
3 changed files with 12 additions and 13 deletions

View file

@ -59,15 +59,17 @@ void help()
void std() void std()
{ {
int precision = -1;
if (stack_size()>=1) if (stack_size()>=1)
{ {
ARG_MUST_BE_OF_TYPE(0, cmd_number); ARG_MUST_BE_OF_TYPE(0, cmd_number);
int precision = int(((number*)_stack->pop_back())->_value); precision = int(((number*)_stack->pop_back())->_value);
number::s_default_precision = int(precision);
} }
number::s_current_precision = number::s_default_precision; if (precision != -1)
number::s_current_precision = precision;
number::s_mode = number::std; number::s_mode = number::std;
// format for mpfr_printf // format for mpfr_printf

View file

@ -39,7 +39,8 @@ extern "C" {
#include <fstream> #include <fstream>
using namespace std; using namespace std;
// default number of printed digits // default mode and number of printed digits
#define DEFAULT_MODE number::std
#define DEFAULT_PRECISION 20 #define DEFAULT_PRECISION 20
// MPFR related constants // MPFR related constants
@ -219,7 +220,6 @@ struct number : public object
fix, fix,
sci sci
} mode_enum; } mode_enum;
static mode_enum s_default_mode;
static mode_enum s_mode; static mode_enum s_mode;
enum { enum {
@ -229,14 +229,11 @@ struct number : public object
} _representation; } _representation;
// precision // precision
static int s_default_precision;
static int s_current_precision; static int s_current_precision;
}; };
number::mode_enum number::s_default_mode = number::std; number::mode_enum number::s_mode = DEFAULT_MODE;
number::mode_enum number::s_mode = number::s_default_mode; int number::s_current_precision = DEFAULT_PRECISION;
int number::s_default_precision = DEFAULT_PRECISION;
int number::s_current_precision = number::s_default_precision;
struct ostring : public object struct ostring : public object
{ {
@ -788,8 +785,8 @@ public:
static void apply_default() static void apply_default()
{ {
//default float precision, float mode, verbosity //default float precision, float mode, verbosity
number::s_mode = number::s_default_mode; number::s_mode = DEFAULT_MODE;
number::s_current_precision = number::s_default_precision; number::s_current_precision = DEFAULT_PRECISION;
// format for mpfr_printf // format for mpfr_printf
stringstream ss; stringstream ss;