Expressions rewritten in a more normal way

(double)'0'? :)
This commit is contained in:
Daniele Varrazzo 2012-03-04 04:47:21 +00:00
parent 5bbfd38dfb
commit 76cc838a93
2 changed files with 2 additions and 2 deletions

View File

@ -239,7 +239,7 @@ typecast_PYINTERVAL_cast(const char *str, Py_ssize_t len, PyObject *curs)
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
v = v*10 + (double)*str - (double)'0';
v = v * 10.0 + (double)(*str - '0');
if (part == 6){
denominator *= 10;
}

View File

@ -142,7 +142,7 @@ typecast_MXINTERVAL_cast(const char *str, Py_ssize_t len, PyObject *curs)
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
v = v*10 + (double)*str - (double)'0';
v = v * 10.0 + (double)(*str - '0');
Dprintf("typecast_MXINTERVAL_cast: v = %f", v);
if (part == 6){
denominator *= 10;