*** empty log message ***
git-svn-id: svn://10.65.10.50/trunk@22 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
65e62eda30
commit
a041c09044
@ -32,8 +32,7 @@ real ::real (double a)
|
||||
|
||||
}
|
||||
|
||||
char *real ::
|
||||
eng2ita (char *s)
|
||||
char *real::eng2ita (char *s)
|
||||
{
|
||||
if (s)
|
||||
{
|
||||
@ -44,8 +43,7 @@ eng2ita (char *s)
|
||||
return s;
|
||||
}
|
||||
|
||||
char *real ::
|
||||
ita2eng (const char *s)
|
||||
char *real::ita2eng (const char *s)
|
||||
{
|
||||
int j = 0;
|
||||
if (s)
|
||||
@ -68,15 +66,13 @@ ita2eng (const char *s)
|
||||
return __string;
|
||||
}
|
||||
|
||||
bool real ::
|
||||
is_real (const char *s)
|
||||
bool real::is_real (const char *s)
|
||||
{
|
||||
bool ok = FALSE;
|
||||
if (s)
|
||||
{
|
||||
while (*s == ' ')
|
||||
s++; // Remove leading spaces before atod
|
||||
|
||||
ok = atod (__tmp_real.ptr (), (char *) s) != GM_NULL;
|
||||
}
|
||||
return ok;
|
||||
@ -148,42 +144,37 @@ real & real ::operator /= (const real & b)
|
||||
return *this;
|
||||
}
|
||||
|
||||
TObject *real ::
|
||||
dup ()
|
||||
const
|
||||
|
||||
|
||||
TObject *real::dup () const
|
||||
{
|
||||
return new real (*this);
|
||||
}
|
||||
|
||||
bool real ::is_zero ()
|
||||
const
|
||||
bool real::is_zero () const
|
||||
{
|
||||
return diszero (ptr ());
|
||||
}
|
||||
|
||||
int real ::sign ()
|
||||
const
|
||||
int real::sign () const
|
||||
{
|
||||
return dsign (ptr ());
|
||||
}
|
||||
|
||||
real real ::operator - ()
|
||||
const
|
||||
real real::operator- () const
|
||||
{
|
||||
real n;
|
||||
dchgs (n.ptr (), ptr ());
|
||||
return n;
|
||||
}
|
||||
|
||||
int real ::integer ()
|
||||
const
|
||||
int real::integer () const
|
||||
{
|
||||
return dtoi (ptr ());
|
||||
}
|
||||
|
||||
// Certified 91%
|
||||
char *real ::string (int len, int dec, char pad)
|
||||
const
|
||||
char *real::string (int len, int dec, char pad) const
|
||||
{
|
||||
__tmp_real = *this;
|
||||
if (dec != UNDEFINED)
|
||||
@ -245,9 +236,7 @@ dup ()
|
||||
}
|
||||
|
||||
// Certified 99%
|
||||
char *real ::
|
||||
stringa (int len, int dec, char pad)
|
||||
const
|
||||
char* real::stringa (int len, int dec, char pad) const
|
||||
|
||||
{
|
||||
string (len, dec, pad);
|
||||
@ -257,8 +246,7 @@ stringa (int len, int dec, char pad)
|
||||
}
|
||||
|
||||
// Certified 75%
|
||||
char *real ::literals ()
|
||||
const
|
||||
char *real::literals () const
|
||||
{
|
||||
const char *primi20[] =
|
||||
{"", "uno", "due", "tre", "quattro",
|
||||
@ -338,9 +326,7 @@ stringa (int len, int dec, char pad)
|
||||
}
|
||||
|
||||
// Certified 75%
|
||||
char *real ::
|
||||
points (int dec)
|
||||
const
|
||||
char *real::points (int dec) const
|
||||
{
|
||||
const char *str = stringa ();
|
||||
const int neg = (*str == '-') ? 1 : 0;
|
||||
@ -371,8 +357,7 @@ points (int dec)
|
||||
return __string;
|
||||
}
|
||||
|
||||
HIDDEN int
|
||||
get_picture_decimals (const TString & picture)
|
||||
HIDDEN int get_picture_decimals (const TString & picture)
|
||||
{
|
||||
int decimali = 0;
|
||||
const int virgola = picture.find (',');
|
||||
@ -386,9 +371,7 @@ get_picture_decimals (const TString & picture)
|
||||
return decimali;
|
||||
}
|
||||
|
||||
char *real ::
|
||||
string (const char *picture)
|
||||
const
|
||||
char *real::string (const char *picture) const
|
||||
{
|
||||
if (*picture == '\0')
|
||||
return string ();
|
||||
@ -449,15 +432,13 @@ ostream & operator << (ostream & out, const real & a)
|
||||
}
|
||||
|
||||
istream& operator>> (istream& in, real& a)
|
||||
|
||||
{
|
||||
in >> __string;
|
||||
atod (a.ptr (), __string);
|
||||
return in;
|
||||
}
|
||||
|
||||
int real ::
|
||||
precision ()
|
||||
int real::precision ()
|
||||
{
|
||||
return dprec (ptr ());
|
||||
}
|
||||
@ -735,6 +716,8 @@ bool operator == (const real & a, const real & b)
|
||||
return __tmp_real;
|
||||
}
|
||||
|
||||
|
||||
|
||||
real log10 (const real& a)
|
||||
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user