Aggiunto trail() agli operatori + e - per evitare casino nei calcoli
git-svn-id: svn://10.65.10.50/trunk@1990 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
ead7d3020a
commit
7092eb8ea3
@ -134,18 +134,21 @@ real & real::operator = (double a)
|
||||
real & real::operator += (const real & b)
|
||||
{
|
||||
dadd (ptr (), ptr (), b.ptr ());
|
||||
trail( );
|
||||
return *this;
|
||||
}
|
||||
|
||||
real & real::operator += (double a)
|
||||
{
|
||||
adddfd (ptr (), ptr (), a);
|
||||
trail( );
|
||||
return *this;
|
||||
}
|
||||
|
||||
real & real::operator -= (const real & b)
|
||||
{
|
||||
dsub (ptr (), ptr (), b.ptr ());
|
||||
trail( );
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -198,6 +201,7 @@ real real::operator - () const
|
||||
{
|
||||
real n;
|
||||
dchgs (n.ptr (), ptr ());
|
||||
// n.trail( );
|
||||
return n;
|
||||
}
|
||||
|
||||
@ -581,22 +585,24 @@ real operator - (
|
||||
// @syntax operator -(const real &a, double b);
|
||||
{
|
||||
dsub (__tmp_real.ptr (), a.ptr (), b.ptr ());
|
||||
__tmp_real.trail();
|
||||
return __tmp_real;
|
||||
}
|
||||
|
||||
real operator - (double a, const real & b)
|
||||
|
||||
{
|
||||
__tmp_real = a;
|
||||
dsub (__tmp_real.ptr (), __tmp_real.ptr (), b.ptr ());
|
||||
__tmp_real.trail( );
|
||||
return __tmp_real;
|
||||
}
|
||||
|
||||
real operator - (const real & a, double b)
|
||||
|
||||
{
|
||||
__tmp_real = b;
|
||||
return __tmp_real -= a;
|
||||
__tmp_real -= a;
|
||||
__tmp_real.trail();
|
||||
return __tmp_real;
|
||||
}
|
||||
|
||||
// @func real | operator * | Moltiplica due numeri reali
|
||||
@ -617,7 +623,6 @@ real operator *(
|
||||
}
|
||||
|
||||
real operator *(double a, const real & b)
|
||||
|
||||
{
|
||||
muldfd (__tmp_real.ptr (), b.ptr (), a);
|
||||
__tmp_real.trail( );
|
||||
@ -625,7 +630,6 @@ real operator *(double a, const real & b)
|
||||
}
|
||||
|
||||
real operator *(const real & a, double b)
|
||||
|
||||
{
|
||||
muldfd (__tmp_real.ptr (), a.ptr (), b);
|
||||
__tmp_real.trail( );
|
||||
@ -639,7 +643,6 @@ real operator / (
|
||||
const real & a, // @parm Primo numero da dividere
|
||||
const real & b) // @parm Secondo numero da dividere
|
||||
|
||||
|
||||
// @syntax operator /(const real &a, const real &b);
|
||||
// @syntax operator /(double a, const real &b);
|
||||
// @syntax operator /(const real &a, double b);
|
||||
@ -650,7 +653,6 @@ real operator / (
|
||||
}
|
||||
|
||||
real operator / (double a, const real & b)
|
||||
|
||||
{
|
||||
__tmp_real = a;
|
||||
ddiv (__tmp_real.ptr (), __tmp_real.ptr (), b.ptr ());
|
||||
@ -659,7 +661,6 @@ real operator / (double a, const real & b)
|
||||
}
|
||||
|
||||
real operator / (const real & a, double b)
|
||||
|
||||
{
|
||||
__tmp_real = b;
|
||||
ddiv (__tmp_real.ptr (), a.ptr (), __tmp_real.ptr ());
|
||||
|
Loading…
x
Reference in New Issue
Block a user