diff options
| author | Guido van Rossum <guido@python.org> | 1991-12-10 13:56:55 +0000 | 
|---|---|---|
| committer | Guido van Rossum <guido@python.org> | 1991-12-10 13:56:55 +0000 | 
| commit | 9a9faddbcb9f61a6dd527aacd41e18dc877649c7 (patch) | |
| tree | 4fb79c62e7e3f08506f4be328078626b041b5261 /Objects | |
| parent | ddc0d3e0665b3ebec26a22e85f9186c472c7ca18 (diff) | |
| download | cpython-git-9a9faddbcb9f61a6dd527aacd41e18dc877649c7.tar.gz | |
Formulate better error strings.
Diffstat (limited to 'Objects')
| -rw-r--r-- | Objects/floatobject.c | 10 | 
1 files changed, 5 insertions, 5 deletions
diff --git a/Objects/floatobject.c b/Objects/floatobject.c index 0966752313..77015b9032 100644 --- a/Objects/floatobject.c +++ b/Objects/floatobject.c @@ -174,7 +174,7 @@ float_div(v, w)  		return NULL;  	}  	if (((floatobject *)w) -> ob_fval == 0) { -		err_setstr(ZeroDivisionError, "float division by zero"); +		err_setstr(ZeroDivisionError, "float division");  		return NULL;  	}  	return newfloatobject(v->ob_fval / ((floatobject *)w) -> ob_fval); @@ -192,7 +192,7 @@ float_rem(v, w)  	}  	wx = ((floatobject *)w) -> ob_fval;  	if (wx == 0.0) { -		err_setstr(ZeroDivisionError, "float division by zero"); +		err_setstr(ZeroDivisionError, "float remainder");  		return NULL;  	}  	return newfloatobject(fmod(v->ob_fval, wx)); @@ -212,7 +212,7 @@ float_divmod(v, w)  	}  	wx = ((floatobject *)w) -> ob_fval;  	if (wx == 0.0) { -		err_setstr(ZeroDivisionError, "float division by zero"); +		err_setstr(ZeroDivisionError, "float divmod()");  		return NULL;  	}  	vx = v->ob_fval; @@ -251,13 +251,13 @@ float_pow(v, w)  		return newfloatobject(1.0); /* x**0 is 1, even 0**0 */  	if (iv == 0.0) {  		if (iw < 0.0) { -			err_setstr(RuntimeError, "0.0 to the negative power"); +			err_setstr(ValueError, "0.0 to the negative power");  			return NULL;  		}  		return newfloatobject(0.0);  	}  	if (iv < 0.0) { -		err_setstr(RuntimeError, "negative float to float power"); +		err_setstr(ValueError, "negative float to float power");  		return NULL;  	}  	errno = 0;  | 
