fix cast from double to long long

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@8458 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2006-01-15 09:18:58 +00:00
commit 5601aff69c
3 changed files with 11 additions and 5 deletions

View file

@ -204,7 +204,7 @@ SWIG_AsVal_dec(ptrdiff_t)(SWIG_Object obj, ptrdiff_t *val)
SWIGINTERNINLINE int
SWIG_CanCastAsInteger(double *d, double min, double max) {
double x = *d;
if (min <= x && x <= max) {
if ((min <= x && x <= max)) {
double fx = floor(x);
double rd = ((x - fx) < 0.5) ? fx : ceil(x); /* simple rint */
if ((errno == EDOM) || (errno == ERANGE)) {