Changeset c41fbf in git


Ignore:
Timestamp:
May 17, 2010, 7:19:45 PM (14 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
78e67ebed527a6a6c46377271737846d0daadcbd
Parents:
4f3b79efc8dad5c9a3fd5fda10687e411d13eb1a
Message:
comparing complex numbers: ignore the imag. part

git-svn-id: file:///usr/local/Singular/svn/trunk@12794 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
kernel
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • kernel/gnumpc.cc

    r4f3b79 rc41fbf  
    382382    return (((gmp_complex*)b)->real().sign() < 0);
    383383  }
    384   if ( b==NULL )
     384  else if ( b==NULL )
    385385  {
    386386    return (((gmp_complex*)a)->real().sign() < 0);
     387  }
     388  else
     389  {
     390    return ((gmp_complex*)a) > ((gmp_complex*)b);
    387391  }
    388392  return FALSE;
  • kernel/mpr_complex.h

    r4f3b79 rc41fbf  
    215215
    216216  inline friend bool operator == ( const gmp_complex & a, const gmp_complex & b );
     217  inline friend bool operator  > ( const gmp_complex & a, const gmp_complex & b );
     218  inline friend bool operator  < ( const gmp_complex & a, const gmp_complex & b );
     219  inline friend bool operator >= ( const gmp_complex & a, const gmp_complex & b );
     220  inline friend bool operator <= ( const gmp_complex & a, const gmp_complex & b );
    217221
    218222  inline gmp_complex & operator = ( const gmp_complex & a );
     
    255259  return ( b.real() == a.real() ) && ( b.imag() == a.imag() );
    256260}
     261inline bool operator  > ( const gmp_complex & a, const gmp_complex & b )
     262{
     263  return ( a.real() > b.real() );
     264}
     265inline bool operator  < ( const gmp_complex & a, const gmp_complex & b )
     266{
     267  return ( a.real() < b.real() );
     268}
     269inline bool operator >= ( const gmp_complex & a, const gmp_complex & b )
     270{
     271  return ( a.real() >= b.real() );
     272}
     273inline bool operator <= ( const gmp_complex & a, const gmp_complex & b )
     274{
     275  return ( a.real() <= b.real() );
     276}
     277
    257278
    258279// <gmp_complex> = <gmp_complex>
Note: See TracChangeset for help on using the changeset viewer.