Method `!()
- Method `!
bool
`!(object
|function
(:void
)arg
)
int(1..1)
`!(int(0..0)
arg
)
int(0..0)
`!(mixed
arg
)- Description
Logical not.
Every expression with the
!
operator becomes a call to this function, i.e.!a
is the same aspredef::`!(a)
.It's also used when necessary to test truth on objects, i.e. in a statement
if (o) ...
whereo
is an object, the test becomes the equivalent of!!o
so that any lfun::`!() the object might have gets called.- Returns
If
arg
is an object that implements lfun::`!(), that function will be called.If
arg
is0
(zero), a destructed object, or a function in a destructed object,1
will be returned.Otherwise
0
(zero) will be returned.- Note
No float is considered false, not even
0.0
.- See also