Changeset f1295f in git
- Timestamp:
- Jun 26, 1998, 6:16:40 PM (26 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 511e63efe177f34a743560226ca4267eb8929c64
- Parents:
- 6dd2895cf5762cfd623523c3f1f6d624f28aa874
- Location:
- factory
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
factory/int_int.cc
r6dd289 rf1295f 1 1 /* emacs edit mode for this file is -*- C++ -*- */ 2 /* $Id: int_int.cc,v 1.1 3 1998-06-12 14:33:50schmidt Exp $ */2 /* $Id: int_int.cc,v 1.14 1998-06-26 16:16:33 schmidt Exp $ */ 3 3 4 4 #include <config.h> … … 56 56 #endif /* NOSTREAMIO */ 57 57 58 bool InternalInteger::isZero() const59 {60 return mpz_cmp_si( &thempi, 0 ) == 0;61 }62 63 bool InternalInteger::isOne() const64 {65 return mpz_cmp_si( &thempi, 1 ) == 0;66 }67 68 58 bool InternalInteger::is_imm() const 69 59 { … … 87 77 } 88 78 89 InternalCF* InternalInteger::neg() 90 { 91 if ( getRefCount() > 1 ) { 92 decRefCount(); 93 MP_INT dummy; 94 mpz_init( &dummy ); 95 mpz_neg( &dummy, &thempi ); 79 //{{{ InternalCF * InternalInteger::neg () 80 // docu: see CanonicalForm::operator -() 81 InternalCF * 82 InternalInteger::neg () 83 { 84 if ( getRefCount() > 1 ) { 85 decRefCount(); 86 MP_INT dummy; 87 mpz_init_set( &dummy, &thempi ); 88 mpz_neg( &dummy, &dummy ); 96 89 return new InternalInteger( dummy ); 97 } 98 else { 90 } else { 99 91 mpz_neg( &thempi, &thempi ); 100 92 return this; 101 93 } 102 94 } 95 //}}} 103 96 104 97 -
factory/int_int.h
r6dd289 rf1295f 1 1 /* emacs edit mode for this file is -*- C++ -*- */ 2 /* $Id: int_int.h,v 1. 8 1998-03-17 15:56:18schmidt Exp $ */2 /* $Id: int_int.h,v 1.9 1998-06-26 16:16:40 schmidt Exp $ */ 3 3 4 4 #ifndef INCL_INT_INT_H … … 46 46 void print( ostream&, char* ); 47 47 #endif /* NOSTREAMIO */ 48 bool isZero() const;49 bool isOne() const;50 48 InternalCF* genZero(); 51 49 InternalCF* genOne();
Note: See TracChangeset
for help on using the changeset viewer.