Changeset 9442dc in git


Ignore:
Timestamp:
Jun 26, 1998, 6:14:26 PM (26 years ago)
Author:
Jens Schmidt <schmidt@…>
Branches:
(u'spielwiese', '4a9821a93ffdc22a6696668bd4f6b8c9de3e6c5f')
Children:
2266ecccffc7f96b6aeac2e03cb376d4dca7573d
Parents:
f23b9a9642dd6bf45b6a2fe22d7942d7e05f6999
Message:
	* int_pp.cc (isOne, isZero): slightly speeded up.  Doc fixes.

	* int_poly.cc, int_pp.cc, int_rat.cc (neg): doc fixes


git-svn-id: file:///usr/local/Singular/svn/trunk@2237 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • factory/int_pp.cc

    rf23b9a r9442dc  
    11/* emacs edit mode for this file is -*- C++ -*- */
    2 /* $Id: int_pp.cc,v 1.8 1997-12-17 11:42:41 schmidt Exp $ */
     2/* $Id: int_pp.cc,v 1.9 1998-06-26 16:14:26 schmidt Exp $ */
    33
    44#include <config.h>
     
    125125#endif /* NOSTREAMIO */
    126126
    127 bool InternalPrimePower::isZero() const
    128 {
    129     return mpz_cmp_si( &thempi, 0 ) == 0;
    130 }
    131 
    132 bool InternalPrimePower::isOne() const
    133 {
    134     return mpz_cmp_si( &thempi, 1 ) == 0;
    135 }
     127//{{{ bool InternalPrimePower::isOne, isZero () const
     128// docu: see CanonicalForm::isOne(), CanonicalForm::isZero()
     129bool
     130InternalPrimePower::isOne () const
     131{
     132    return mpz_cmp_ui( &thempi, 1 ) == 0;
     133}
     134
     135bool
     136InternalPrimePower::isZero () const
     137{
     138    return mpz_sgn( &thempi ) == 0;
     139}
     140//}}}
    136141
    137142bool InternalPrimePower::is_imm() const
     
    156161}
    157162
    158 InternalCF* InternalPrimePower::neg()
     163//{{{ InternalCF * InternalPrimePower::neg ()
     164// docu: see CanonicalForm::operator -()
     165InternalCF *
     166InternalPrimePower::neg ()
    159167{
    160168    if ( getRefCount() > 1 ) {
     
    164172        mpz_sub( &dummy, &primepow, &thempi );
    165173        return new InternalPrimePower( dummy );
    166     }
    167     else {
     174    } else {
    168175        mpz_sub( &thempi, &primepow, &thempi );
    169176        return this;
    170177    }
    171178}
     179//}}}
    172180
    173181
Note: See TracChangeset for help on using the changeset viewer.