Changeset 2b44a1 in git for factory/int_int.cc


Ignore:
Timestamp:
Dec 4, 2007, 4:24:53 PM (16 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
76cee4ecf4f4ebb3a8aa88178fdda32dc26fe987
Parents:
01c4861ef358d95157809da52c75de1595678444
Message:
*hannes: format


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

Legend:

Unmodified
Added
Removed
  • factory/int_int.cc

    r01c486 r2b44a1  
    11/* emacs edit mode for this file is -*- C++ -*- */
    2 /* $Id: int_int.cc,v 1.18 2006-05-15 09:03:06 Singular Exp $ */
     2/* $Id: int_int.cc,v 1.19 2007-12-04 15:24:53 Singular Exp $ */
    33
    44#include <config.h>
     
    384384
    385385    // simply return 1 if we are calculating over the rationals
    386     if ( cf_glob_switches.isOn( SW_RATIONAL ) ) {
     386    if ( cf_glob_switches.isOn( SW_RATIONAL ) )
     387    {
    387388        a = 1/CanonicalForm( copyObject() ); b = 0;
    388389        return int2imm( 1 );
     
    399400
    400401    // check and modify signs
    401     if ( mpz_sgn( &result ) < 0 ) {
     402    if ( mpz_sgn( &result ) < 0 )
     403    {
    402404        mpz_neg( &result, &result );
    403405        mpz_neg( &aMPI, &aMPI );
     
    406408
    407409    // postconditioning of result
    408     if ( mpz_is_imm( &aMPI ) ) {
     410    if ( mpz_is_imm( &aMPI ) )
     411    {
    409412        a = CanonicalForm( int2imm( mpz_get_si( &aMPI ) ) );
    410413        mpz_clear( &aMPI );
    411     } else
     414    }
     415    else
    412416        a = CanonicalForm( new InternalInteger( aMPI ) );
    413     if ( mpz_is_imm( &bMPI ) ) {
     417    if ( mpz_is_imm( &bMPI ) )
     418    {
    414419        b = CanonicalForm( int2imm( mpz_get_si( &bMPI ) ) );
    415420        mpz_clear( &bMPI );
    416     } else
     421    }
     422    else
    417423        b = CanonicalForm( new InternalInteger( bMPI ) );
    418     if ( mpz_is_imm( &result ) ) {
     424    if ( mpz_is_imm( &result ) )
     425    {
    419426        InternalCF * res = int2imm( mpz_get_si( &result ) );
    420427        mpz_clear( &result );
     
    431438
    432439    // simply return 1 if we are calculating over the rationals
    433     if ( cf_glob_switches.isOn( SW_RATIONAL ) ) {
     440    if ( cf_glob_switches.isOn( SW_RATIONAL ) )
     441    {
    434442        a = 1/CanonicalForm( copyObject() ); b = 0;
    435443        return int2imm( 1 );
     
    439447
    440448    // trivial cases
    441     if ( cInt == 1 || cInt == -1 ) {
     449    if ( cInt == 1 || cInt == -1 )
     450    {
    442451        a = 0; b = cInt;
    443452        return int2imm( 1 );
    444     } else if ( cInt == 0 ) {
     453    }
     454    else if ( cInt == 0 )
     455    {
    445456        a = 1; b = 0;
    446457        return copyObject();
     
    493504    mpz_init( &result );
    494505    mpz_sqrt( &result, &thempi );
    495     if ( mpz_is_imm( &result ) ) {
     506    if ( mpz_is_imm( &result ) )
     507    {
    496508        InternalCF * res = int2imm( mpz_get_si( &result ) );
    497509        mpz_clear( &result );
Note: See TracChangeset for help on using the changeset viewer.