mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
Added nonzero test
This commit is contained in:
parent
fb8edfce22
commit
50b4ef64eb
1 changed files with 8 additions and 0 deletions
|
|
@ -260,6 +260,13 @@ float_abs(v)
|
|||
return float_pos(v);
|
||||
}
|
||||
|
||||
static int
|
||||
float_nonzero(v)
|
||||
floatobject *v;
|
||||
{
|
||||
return v->ob_fval != 0.0;
|
||||
}
|
||||
|
||||
static number_methods float_as_number = {
|
||||
float_add, /*nb_add*/
|
||||
float_sub, /*nb_subtract*/
|
||||
|
|
@ -271,6 +278,7 @@ static number_methods float_as_number = {
|
|||
float_neg, /*nb_negative*/
|
||||
float_pos, /*nb_positive*/
|
||||
float_abs, /*nb_absolute*/
|
||||
float_nonzero, /*nb_nonzero*/
|
||||
};
|
||||
|
||||
typeobject Floattype = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue