Changeset 9899df in git for factory/gmpext.h


Ignore:
Timestamp:
Nov 11, 2010, 5:26:41 PM (13 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', '17f1d200f27c5bd38f5dfc6e8a0879242279d1d8')
Children:
8b2ef529c04c7b3517f5001ff6c69e582bb9fd09
Parents:
c73520d5d0c7a156ce1ef3256417b5157e57cc61
Message:
mpz_mypow -> mpz_pow_ui, mpz_mypow_ui ->mpz_ui_pow_ui

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

Legend:

Unmodified
Added
Removed
  • factory/gmpext.h

    rc73520d r9899df  
    2020}
    2121
    22 inline void
    23 mpz_mypow_ui( MP_INT * result, int p, int n )
    24 {
    25     if ( p == 0 )
    26         mpz_set_ui( result, 0 );
    27     else  if ( n == 0 )
    28         mpz_set_ui( result, 1 );
    29     else {
    30         mpz_set_ui( result, p );
    31         n--;
    32         while ( n > 0 ) {
    33             mpz_mul_ui( result, result, p );
    34             n--;
    35         }
    36     }
    37 }
    38 
    39 inline void
    40 mpz_mypow( MP_INT * result, MP_INT * p, int n )
    41 {
    42     // p == 0 && n == 0 should not happen since this function is only used
    43     // in the factorizing algorithm
    44     mpz_set( result, p );
    45     n--;
    46     while ( n > 0 ) {
    47         mpz_mul( result, result, p );
    48         n--;
    49     }
    50 }
    51 
    5222#endif /* ! INCL_GMPEXT_H */
Note: See TracChangeset for help on using the changeset viewer.