Changeset 7bf4b7 in git for kernel


Ignore:
Timestamp:
Feb 18, 2010, 12:18:19 PM (14 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '4188d308699580d975efd0f6cca8dcb41c396f70')
Children:
e5af4f0868c1101450c507a01d0cc4909e954fcb
Parents:
cd2d901a045b1d74d20f86f668a4b0e1e3e54de8
Message:
format

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

Legend:

Unmodified
Added
Removed
  • kernel/GMPrat.cc

    rcd2d90 r7bf4b7  
    6464{
    6565    p = new rep;
    66     mpq_init( p->rat );
    67     mpq_set_si( p->rat,(long int)a,1 );
     66    mpq_init_set_si( p->rat,(long)a,1 );
    6867}
    6968
     
    8988    if (b<0) a=-a;
    9089    p=new rep;
    91     mpq_init(p->rat);
    92     mpq_set_si(p->rat,(long int) a,(unsigned long int) abs(b));
     90    mpq_init_set_si(p->rat,(long) a,(unsigned long) abs(b));
    9391    mpq_canonicalize(p->rat);
    9492}
     
    10098Rational::~Rational()
    10199{
    102   if (--p->n==0){
     100  if (--(p->n)==0)
     101  {
    103102    mpq_clear(p->rat);
    104103    delete p;
     
    113112{
    114113  disconnect();
    115   mpq_set_si(p->rat,(long int) a,1);
     114  mpq_set_si(p->rat,(long) a,1);
    116115  return *this;
    117116}
     
    120119{
    121120  a.p->n++;
    122   if (--p->n==0){
     121  if (--(p->n)==0)
     122  {
    123123    mpq_clear(p->rat);
    124124    delete p;
     
    166166Rational::operator int()
    167167{
    168   mpz_t
    169     h;
    170   long int
    171     ret_val;
     168  mpz_t h;
     169  long ret_val;
    172170
    173171  mpz_init(h);
     
    186184Rational::operator-()
    187185{
    188   Rational
    189     erg;
     186  Rational erg;
    190187
    191188  mpq_neg(erg.p->rat,p->rat);
     
    195192Rational operator - ( const Rational &r )
    196193{
    197   Rational
    198     erg;
     194  Rational erg;
    199195
    200196  mpq_neg(erg.p->rat,r.p->rat);
     
    209205Rational::operator~()
    210206{
    211   Rational
    212     erg;
     207  Rational erg;
    213208
    214209  mpq_inv(erg.p->rat,p->rat);
     
    272267Rational::operator++(int)
    273268{
    274   Rational
    275     erg(*this);
     269  Rational erg(*this);
    276270
    277271  mpq_set(save.p->rat,p->rat);
     
    293287Rational::operator--(int)
    294288{
    295   Rational
    296     erg(*this);
     289  Rational erg(*this);
    297290
    298291  mpq_set(save.p->rat,p->rat);
Note: See TracChangeset for help on using the changeset viewer.