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