Show
Ignore:
Timestamp:
04/02/08 14:08:58 (9 months ago)
Author:
pernet
Message:

fix the multiple type conversion error, raised by T Abbott (sage/debian project)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • include/fflas-ffpack/fflas_bounds.inl

    r56 r60  
    5050                        for (size_t i=0; i < w; ++i)    ex *= 3; 
    5151                        //FFLAS_INT_TYPE c = (p-1)*(ex)/2; //bound for a centered representation 
    52                         long long c; 
     52                        FFLAS_INT_TYPE c; 
    5353#ifndef _LINBOX_LINBOX_CONFIG_H 
    5454                        if (F.balanced) 
     
    6262                } 
    6363                else{ 
    64                         long long c = p-1; 
    65                         long long cplt=0; 
     64                        FFLAS_INT_TYPE c = p-1; 
     65                        FFLAS_INT_TYPE cplt=0; 
    6666                        if (!F.isZero (beta)) 
    6767                                if (F.isOne (beta) || F.areEqual (beta, mone)) 
     
    106106// Computes nmax s.t. (p-1)/2*(p^{nmax-1} + (p-2)^{nmax-1}) < 2^53 
    107107//--------------------------------------------------------------------- 
    108 inline size_t bound_compute_double(const long long pi) { 
    109          
    110         long long p=pi,p1=1,p2=1; 
    111         size_t nmax=1; 
    112         double max = ( (  1ULL<<(DOUBLE_MANTISSA+1) )/(p-1)); 
     108inline size_t bound_compute_double(const FFLAS_INT_TYPE pi) { 
     109         
     110        FFLAS_INT_TYPE p=pi,p1=1,p2=1; 
     111        size_t nmax = 1; 
     112        FFLAS_INT_TYPE max = ( FFLAS_INT_TYPE(  1ULL<<(DOUBLE_MANTISSA+1) )/(p-1)); 
    113113        while ( (p1 + p2) < max ){ 
    114114                p1*=p; 
     
    119119        return nmax; 
    120120} 
    121 inline size_t bound_compute_double_balanced(const long long pi) { 
    122          
    123         long long p=(pi+1)/2,p1=1; 
     121inline size_t bound_compute_double_balanced(const FFLAS_INT_TYPE pi) { 
     122         
     123        FFLAS_INT_TYPE p=(pi+1)/2,p1=1; 
    124124        size_t nmax=0; 
    125         double max = ( (  1ULL<<(DOUBLE_MANTISSA))/(p-1)); 
     125        FFLAS_INT_TYPE max = ( FFLAS_INT_TYPE(  1ULL<<(DOUBLE_MANTISSA))/(p-1)); 
    126126        while ( (p1) < max ){ 
    127127                p1*=p; 
     
    130130        return nmax; 
    131131} 
    132 inline size_t bound_compute_float(const long long pi) { 
    133          
    134         long long p=pi,p1=1,p2=1; 
     132inline size_t bound_compute_float(const FFLAS_INT_TYPE pi) { 
     133         
     134        FFLAS_INT_TYPE p=pi,p1=1,p2=1; 
    135135        size_t nmax=1; 
    136         double max = ( (  1ULL<<(FLOAT_MANTISSA+1) )/(p-1)); 
     136        FFLAS_INT_TYPE max = (FFLAS_INT_TYPE(   1ULL<<(FLOAT_MANTISSA+1) )/(p-1)); 
    137137        while ( (p1 + p2) < max ){ 
    138138                p1*=p; 
     
    143143        return nmax; 
    144144} 
    145 inline size_t bound_compute_float_balanced(const long long pi) { 
    146          
    147         long long p=(pi+1)/2,p1=1; 
     145inline size_t bound_compute_float_balanced(const FFLAS_INT_TYPE pi) { 
     146         
     147        FFLAS_INT_TYPE p=(pi+1)/2,p1=1; 
    148148        size_t nmax=0; 
    149         double max = ( (  1ULL<<(FLOAT_MANTISSA))/(p-1)); 
     149        FFLAS_INT_TYPE max = ( FFLAS_INT_TYPE(  1ULL<<(FLOAT_MANTISSA))/(p-1)); 
    150150        while ( (p1) < max ){ 
    151151                p1*=p;