diff --git a/Algebraic_foundations/include/CGAL/ipower.h b/Algebraic_foundations/include/CGAL/ipower.h index 6b107816061..ba04c58119d 100644 --- a/Algebraic_foundations/include/CGAL/ipower.h +++ b/Algebraic_foundations/include/CGAL/ipower.h @@ -65,12 +65,12 @@ NT ipower(const NT& base, long expn) { if (expn == 1) return base; // find the most significant non-zero bit of expn - int e = expn, msb = 0; + long e = expn, msb = 0; while (e >>= 1) msb++; // computing base^expn by square-and-multiply NT res = base; - int b = 1<>= 1) { // is there another bit right of what we saw so far? res *= res; if (expn & b) res *= base; diff --git a/Geomview/include/CGAL/IO/Geomview_stream_impl.h b/Geomview/include/CGAL/IO/Geomview_stream_impl.h index 7eb8dd2fb36..5f622047cf2 100644 --- a/Geomview/include/CGAL/IO/Geomview_stream_impl.h +++ b/Geomview/include/CGAL/IO/Geomview_stream_impl.h @@ -297,9 +297,9 @@ CGAL_INLINE_FUNCTION Geomview_stream& Geomview_stream::operator<<(double d) { - float f = d; + float f = float(d); if (get_binary_mode()) { - float num = d; + float num = float(d); I_swap_to_big_endian(num); std::size_t retwrite= ::write(out, (char*)&num, sizeof(num)); (void)retwrite; diff --git a/Kinetic_data_structures/include/CGAL/Polynomial/internal/Turkowski_numeric_solvers_impl.h b/Kinetic_data_structures/include/CGAL/Polynomial/internal/Turkowski_numeric_solvers_impl.h index bac3c7429d4..0bdabdf2b7d 100644 --- a/Kinetic_data_structures/include/CGAL/Polynomial/internal/Turkowski_numeric_solvers_impl.h +++ b/Kinetic_data_structures/include/CGAL/Polynomial/internal/Turkowski_numeric_solvers_impl.h @@ -150,8 +150,8 @@ FindPolynomialRoots( int number_of_ITERATE=0; int number_of_INIT=0; CGAL_precondition(static_cast(fig) < MAXN); - int i; - int j; + long i; + long j; FLOAT h[MAXN + 3], b[MAXN + 3], c[MAXN + 3], d[MAXN + 3], e[MAXN + 3]; /* [-2 : n] */ FLOAT K, ps, qs, pt, qt, s, rev, r= std::numeric_limits::infinity(); @@ -200,7 +200,7 @@ FindPolynomialRoots( for (j = n; j >= 0; j--) /* Find geometric mean of coeff's */ if (h[2 + j] != 0.0) s += std::log( ::CGAL::abs(h[2 + j])); - s = std::exp(s / (n + 1)); + s = std::exp(s / double(n + 1)); for (j = n; j >= 0; j--) /* Normalize coeff's by mean */ h[2 + j] /= s; @@ -413,8 +413,8 @@ void Turkowski_polynomial_compute_roots(const double *begin, const double *end, case 3: { double rd[3]; - int numr= FindCubicRoots(begin, rd); - for (int i=numr-1; i>=0; --i) { + long numr= FindCubicRoots(begin, rd); + for (long i=numr-1; i>=0; --i) { if (rd[i] >= lb && rd[i] < ub) roots.push_back(rd[i]); } std::sort(roots.begin(), roots.end(), std::greater()); @@ -446,9 +446,9 @@ void Turkowski_polynomial_compute_cleaned_roots(const double *begin, const doubl case 3: { double rd[3]; - int numr= FindCubicRoots(begin, rd); + long numr= FindCubicRoots(begin, rd); double last=-std::numeric_limits::infinity(); - for (int i=numr-1; i>=0; --i) { + for (long i=numr-1; i>=0; --i) { if (rd[i]< ub && rd[i] >= lb) roots.push_back(rd[i]); if (rd[i] < lb && rd[i] > last){ last=rd[i]; diff --git a/Spatial_sorting/include/CGAL/Multiscale_sort.h b/Spatial_sorting/include/CGAL/Multiscale_sort.h index bfc67420d6f..e0ecd6f5a1f 100644 --- a/Spatial_sorting/include/CGAL/Multiscale_sort.h +++ b/Spatial_sorting/include/CGAL/Multiscale_sort.h @@ -46,7 +46,7 @@ public: typedef typename std::iterator_traits::difference_type difference_type; RandomAccessIterator middle = begin; if (end - begin >= _threshold) { - middle = begin + difference_type ((end - begin) * _ratio); + middle = begin + difference_type (double(end - begin) * _ratio); this->operator() (begin, middle); } _sort (middle, end);